-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 737 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (23 loc) · 737 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
FROM golang:1.23 AS builder
ARG POSTGRES_VERSION=15
RUN apt-get update && apt-get install -y \
postgresql-client-${POSTGRES_VERSION} \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod tidy
COPY . .
RUN go build -o pgsnapsafe cmd/app/main.go
FROM debian:bookworm-slim
ARG POSTGRES_VERSION=15
RUN apt-get update && apt-get install -y \
postgresql-client-${POSTGRES_VERSION} \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/pgsnapsafe /usr/local/bin/pgsnapsafe
COPY /pkg/email/template /app/pkg/email/template
COPY config-example.yml .env /app/
RUN chmod +x /usr/local/bin/pgsnapsafe
CMD ["/usr/local/bin/pgsnapsafe"]