-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (26 loc) · 885 Bytes
/
Dockerfile
File metadata and controls
39 lines (26 loc) · 885 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
38
39
FROM golang:1.25.4 AS backend_builder
ARG TARGETPLATFORM
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY ./cmd /app/cmd
COPY ./dev-scripts /app/dev-scripts
COPY ./handlers /app/handlers
COPY ./limit /app/limit
COPY ./random /app/random
COPY ./store /app/store
RUN TARGETPLATFORM="${TARGETPLATFORM}" ./dev-scripts/build-backend "prod"
FROM scratch AS artifact
COPY --from=backend_builder /app/bin/logpaste ./
FROM litestream/litestream:0.3.9 AS litestream
FROM alpine:3.15
RUN apk add --no-cache bash
COPY --from=backend_builder /app/bin/logpaste /app/logpaste
COPY --from=litestream /usr/local/bin/litestream /app/litestream
COPY ./docker-entrypoint /app/docker-entrypoint
COPY ./litestream.yml /etc/litestream.yml
COPY ./views /app/views
WORKDIR /app
# Frequency that database snapshots are replicated.
ENV DB_SYNC_INTERVAL="10s"
ENTRYPOINT ["/app/docker-entrypoint"]