Files
7am/Dockerfile

29 lines
503 B
Docker
Raw Normal View History

2025-05-10 19:43:13 +01:00
FROM golang:1.24 AS builder
2025-05-10 17:35:51 +01:00
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
2025-05-11 16:56:46 +01:00
COPY prompt.txt ./
2025-05-10 17:35:51 +01:00
COPY web ./web
RUN CGO_ENABLED=0 GOOS=linux go build -o ./server
2025-05-10 19:43:13 +01:00
FROM alpine:3.21.3
2025-05-10 17:35:51 +01:00
2025-05-10 19:43:13 +01:00
ARG uid
ARG gid
RUN apk add --no-cache tzdata && addgroup -g ${gid} -S nonroot && adduser -u ${uid} -S nonroot -G nonroot
2025-05-10 17:35:51 +01:00
2025-05-10 19:43:13 +01:00
COPY --from=builder --chown=nonroot:nonroot /app/server /app/server
2025-05-10 17:35:51 +01:00
WORKDIR /app
2025-05-10 19:43:13 +01:00
RUN chown -R nonroot:nonroot /app
USER nonroot:nonroot
2025-05-10 17:35:51 +01:00
EXPOSE 8080
ENTRYPOINT ["./server"]