-
-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathrest-server.Dockerfile
More file actions
37 lines (24 loc) · 736 Bytes
/
Copy pathrest-server.Dockerfile
File metadata and controls
37 lines (24 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM golang:1.23.4-bookworm AS builder
# Explicitly NOT setting a default value
ARG TAG
WORKDIR /build/
COPY . .
ENV CGO_ENABLED=1 \
GOOS=linux
RUN go mod download && \
go build -a -installsuffix cgo -ldflags "-extldflags -static" -tags=$TAG \
github.com/MarioCarrion/todo-api/cmd/rest-server
#-
FROM debian:bookworm-20241223-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /api/
ENV PATH=/api/bin/:$PATH
COPY --from=builder /build/rest-server ./bin/rest-server
COPY --from=builder /build/env.example .
EXPOSE 9234
CMD ["rest-server", "-env", "/api/env.example"]