forked from hiddewie/OpenRailwayMap-vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.Dockerfile
More file actions
86 lines (61 loc) · 2.44 KB
/
proxy.Dockerfile
File metadata and controls
86 lines (61 loc) · 2.44 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM node:22-alpine@sha256:e4bf2a82ad0a4037d28035ae71529873c069b13eb0455466ae0bc13363826e34 AS build-yaml
WORKDIR /build
RUN npm install yaml@2.8.1
FROM build-yaml AS build-styles
RUN --mount=type=bind,source=proxy/js/styles.mjs,target=styles.mjs \
--mount=type=bind,source=features,target=features \
node /build/styles.mjs
FROM build-yaml AS build-legend
RUN --mount=type=bind,source=proxy/js/legend.mjs,target=legend.mjs \
--mount=type=bind,source=features,target=features \
node /build/legend.mjs \
> /build/legend.json
FROM build-yaml AS build-taginfo
RUN npm install chroma-js@3.1.2
RUN --mount=type=bind,source=proxy,target=proxy \
--mount=type=bind,source=features,target=features \
node proxy/js/taginfo.mjs \
> /build/taginfo.json
FROM build-yaml AS build-features
RUN --mount=type=bind,source=proxy/js/features.mjs,target=features.mjs \
--mount=type=bind,source=features,target=features \
node /build/features.mjs \
> /build/features.json
FROM python:3-alpine@sha256:faee120f7885a06fcc9677922331391fa690d911c020abb9e8025ff3d908e510 AS build-preset
RUN apk add --no-cache zip
RUN pip install --no-cache-dir \
pyyaml \
yattag
WORKDIR /build
ARG PRESET_VERSION
RUN --mount=type=bind,source=proxy/preset.py,target=preset.py \
--mount=type=bind,source=features,target=features \
python preset.py \
> preset.xml
RUN --mount=type=bind,source=symbols,target=symbols \
zip -o /build/preset.zip -r -q \
symbols \
preset.xml
FROM nginx:1-alpine@sha256:1d13701a5f9f3fb01aaa88cef2344d65b6b5bf6b7d9fa4cf0dca557a8d7702ba
COPY proxy/script/with-news-hash.sh /with-news-hash.sh
COPY proxy/proxy.conf.template /etc/nginx/templates/proxy.conf.template
COPY proxy/manifest.json /etc/nginx/public/manifest.json
COPY proxy/index.html /etc/nginx/public/index.html
COPY proxy/news.html /etc/nginx/public/news.html
COPY proxy/api /etc/nginx/public/api
COPY proxy/js /etc/nginx/public/js
COPY proxy/css /etc/nginx/public/css
COPY proxy/image /etc/nginx/public/image
COPY proxy/ssl /etc/nginx/ssl
COPY --from=build-styles \
/build /etc/nginx/public/style
COPY --from=build-legend \
/build/legend.json /etc/nginx/public/legend.json
COPY --from=build-taginfo \
/build/taginfo.json /etc/nginx/public/taginfo.json
COPY --from=build-preset \
/build/preset.zip /etc/nginx/public/preset.zip
COPY --from=build-features \
/build/features.json /etc/nginx/public/features.json
ENTRYPOINT ["/with-news-hash.sh"]
CMD ["nginx", "-g", "daemon off;"]