-
Notifications
You must be signed in to change notification settings - Fork 530
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 850 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 850 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
FROM golang:1.21-bookworm AS builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . ./
# Build the binary.
RUN go build -v -o server
RUN wget https://github.com/minio/certgen/releases/latest/download/certgen-linux-amd64 -O /tmp/certgen \
&& chmod +x /tmp/certgen
RUN /tmp/certgen -host "127.0.0.1,gateway-service,api.mypremiumdealership.com,mypremiumdealership.com"
RUN ls -la
FROM debian:bookworm-slim
SHELL ["/bin/bash", "-c"]
WORKDIR /app
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy the binary to the production image from the builder stage.
COPY --from=builder /app/server /app/server
COPY --from=builder /app/public.crt /app/server.crt
COPY --from=builder /app/private.key /app/server.key
EXPOSE 443
CMD ["/app/server"]