blob: 1f43c6d09370a5b6ab731d3fcd43c3650660c5c0 (
plain) (
blame)
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
|
# Build backend
FROM golang:1.23.3-alpine3.20 AS backend
WORKDIR /srv
RUN apk update --no-cache && apk add --no-cache tzdata
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -o app .
# Build frontend
FROM node:23.3-alpine3.20 AS frontend
WORKDIR /srv
COPY package.json package-lock.json ./
RUN npm install
COPY frontend ./frontend
COPY --from=backend /srv/app /usr/bin/app
RUN app frontend build
# Runtime container
FROM alpine:3.20
WORKDIR /srv
RUN apk update --no-cache && apk add --no-cache ca-certificates
COPY --from=backend /usr/share/zoneinfo/Europe/Moscow /usr/share/zoneinfo/Europe/Moscow
COPY --from=backend /srv/app /srv/app
COPY ./static/index.html /srv/static/index.html
COPY --from=frontend /srv/static/assets /srv/static/assets
ENV TZ=Europe/Moscow
EXPOSE 8000
ENTRYPOINT ["/srv/app"]
|