b
This commit is contained in:
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM golang:1.23-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd ./cmd/
|
||||
COPY templates ./templates/
|
||||
COPY static ./static/
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/server ./cmd
|
||||
|
||||
FROM scratch
|
||||
WORKDIR /
|
||||
COPY --from=build /app/server /server
|
||||
COPY --from=build /app/templates /templates
|
||||
COPY --from=build /app/static /static
|
||||
ENV GIN_MODE=release
|
||||
EXPOSE 8000 8080
|
||||
ENTRYPOINT ["/server"]
|
||||
Reference in New Issue
Block a user