增加邮件注册和登录功能
This commit is contained in:
33
services/user-service/user-register-email/Dockerfile
Normal file
33
services/user-service/user-register-email/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM rust:1.94.1-alpine3.23 AS builder
|
||||
|
||||
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY services/user-service/user-register-email/Cargo.toml services/user-service/user-register-email/Cargo.lock* ./
|
||||
|
||||
RUN mkdir -p src && echo 'fn main() {}' > src/main.rs
|
||||
RUN cargo build --release 2>/dev/null || true
|
||||
RUN rm -rf src
|
||||
|
||||
COPY services/user-service/user-register-email/src ./src
|
||||
|
||||
RUN touch src/main.rs && cargo build --release
|
||||
|
||||
FROM alpine:3.23 AS runtime
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
RUN addgroup -g 1000 appuser && adduser -D -u 1000 -G appuser appuser
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/target/release/user-register-email /app/user-register-email
|
||||
|
||||
RUN chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./user-register-email"]
|
||||
Reference in New Issue
Block a user