add
This commit is contained in:
21
trading_assistant_api/services/user/Dockerfile
Normal file
21
trading_assistant_api/services/user/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM golang:1.25.7-alpine3.23 AS builder
|
||||
WORKDIR /workspace
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# copy monorepo workspace and modules needed for user service
|
||||
COPY go.work .
|
||||
COPY common ./common
|
||||
COPY services/user ./services/user
|
||||
|
||||
# download deps and build binary
|
||||
RUN cd services/user && go mod download
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /workspace/bin/user-service ./services/user
|
||||
|
||||
FROM alpine:3.19
|
||||
RUN adduser -D -u 10001 app
|
||||
USER app
|
||||
COPY --from=builder /workspace/bin/user-service /usr/local/bin/user-service
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/usr/local/bin/user-service"]
|
||||
Reference in New Issue
Block a user