dockerfile created
This commit is contained in:
parent
e5713dd67e
commit
392cdbfd4d
2 changed files with 39 additions and 0 deletions
34
Dockerfile
Normal file
34
Dockerfile
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
FROM golang:1.25.1-alpine3.22 AS builder
|
||||
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
ca-certificates
|
||||
|
||||
|
||||
RUN apk add --no-cache tzdata
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd
|
||||
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
ca-certificates \
|
||||
tzdata
|
||||
|
||||
COPY --from=builder /app/main /usr/local/bin/app
|
||||
|
||||
|
||||
RUN chmod +x /usr/local/bin/app
|
||||
RUN adduser -D -s /bin/bash appuser
|
||||
USER appuser
|
||||
|
||||
ENTRYPOINT ["app"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue