forked from mtusi2026/mtusi2026lab4
chore(app) migrated lab3 files
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
FROM golang:1.27.1-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY app/go.mod app/go.sum ./
|
||||
RUN go mod download
|
||||
COPY app/ ./
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN addgroup -S -g 10001 app && adduser -S -u 10001 -G app app
|
||||
|
||||
COPY --from=build /out/server /usr/local/bin/server
|
||||
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/usr/local/bin/server"]
|
||||
Reference in New Issue
Block a user