-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
51 lines (37 loc) · 1.48 KB
/
Dockerfile
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
40
41
42
43
44
45
46
47
48
49
50
51
# syntax=docker/dockerfile:1
FROM python:3.12 as draw
RUN --mount=type=bind,source=draw/requirements.txt,target=/tmp/requirements.txt \
pip install -r /tmp/requirements.txt
COPY draw/draw.py ./
ARG CONFIG=my.conf
RUN --mount=type=bind,source=$CONFIG,target=/tmp/default.conf \
python draw.py --config /tmp/default.conf --codes codes.json > pairs.json
FROM node:20 as site
COPY ./site/package*.json ./
RUN npm ci --omit=dev
COPY site ./
COPY --from=draw ./pairs.json ./src/
ARG I18N_LANGUAGE="en" \
I18N_OVERRIDE_HTML_TITLE="" \
I18N_OVERRIDE_CODE_PROMPT="" \
I18N_OVERRIDE_CODE_INVALID="" \
I18N_OVERRIDE_USER_HI="" \
I18N_OVERRIDE_USER_WHO="" \
I18N_OVERRIDE_USER_BACK="" \
I18N_OVERRIDE_SANTA_PRESENT="" \
I18N_OVERRIDE_SANTA_EXTRA=""
ENV PUBLIC_I18N_LANGUAGE="${I18N_LANGUAGE}" \
PUBLIC_I18N_OVERRIDE_HTML_TITLE="${I18N_OVERRIDE_HTML_TITLE}" \
PUBLIC_I18N_OVERRIDE_CODE_PROMPT="${I18N_OVERRIDE_CODE_PROMPT}" \
PUBLIC_I18N_OVERRIDE_CODE_INVALID="${I18N_OVERRIDE_CODE_INVALID}" \
PUBLIC_I18N_OVERRIDE_USER_HI="${I18N_OVERRIDE_USER_HI}" \
PUBLIC_I18N_OVERRIDE_USER_WHO="${I18N_OVERRIDE_USER_WHO}" \
PUBLIC_I18N_OVERRIDE_USER_BACK="${I18N_OVERRIDE_USER_BACK}" \
PUBLIC_I18N_OVERRIDE_SANTA_PRESENT="${I18N_OVERRIDE_SANTA_PRESENT}" \
PUBLIC_I18N_OVERRIDE_SANTA_EXTRA="${I18N_OVERRIDE_SANTA_EXTRA}"
RUN npm run build
FROM caddy:2
COPY --from=site ./dist /srv
COPY --from=draw ./codes.json /
EXPOSE 80
CMD [ "caddy", "file-server" ]