feat(container): Dockerfile
This commit is contained in:
parent
bd70ac4542
commit
d51e78a442
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
tmp
|
||||||
|
docker-compose.yaml
|
||||||
|
.air.toml
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM golang:1.23-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -o server
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /app/server /server
|
||||||
|
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/ca-certificates.crt
|
||||||
|
ENTRYPOINT [ "/server" ]
|
Loading…
x
Reference in New Issue
Block a user