-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 891 Bytes
/
Dockerfile
File metadata and controls
35 lines (23 loc) · 891 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 debian:bookworm-slim AS cache
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
FROM golang:bookworm AS backend
WORKDIR /app
RUN go install github.com/a-h/templ/cmd/templ@latest
COPY ./go.mod ./go.sum ./
RUN go mod download
COPY . .
# Pre-built assets from CI
COPY ./assets/js/admin ./assets/js/admin
COPY ./assets/js/timeslider/assets/timeslider.js ./assets/js/timeslider/assets/timeslider.js
COPY ./assets/js/pad/assets/pad.js ./assets/js/pad/assets/pad.js
COPY ./assets/js/welcome/assets/welcome.js ./assets/js/welcome/assets/welcome.js
COPY ./assets/css/build ./assets/css/build
RUN templ generate
RUN go build -o app .
FROM scratch AS runtime
EXPOSE 3000
ENV NODE_ENV=production
ENV ETHERPAD_SETTINGS_PATH=/
COPY --from=backend /app/app /app
COPY --from=cache /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/app"]