init: first init
This commit is contained in:
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
|
||||
# Set workdir
|
||||
WORKDIR /lib/autocal
|
||||
|
||||
# Copy go modules
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy rest of source code
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /lib/autocal/app .
|
||||
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
RUN addgroup -S autocal_group && adduser -S autocal_user -G autocal_group
|
||||
USER autocal_user
|
||||
|
||||
WORKDIR /lib/autocal
|
||||
|
||||
COPY --from=builder /lib/autocal/app .
|
||||
COPY --from=builder /lib/autocal/credentials.json .
|
||||
|
||||
EXPOSE 4444
|
||||
|
||||
ENTRYPOINT ["/lib/autocal/app"]
|
||||
Reference in New Issue
Block a user