-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (38 loc) · 1.26 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
52
53
54
55
ARG NODE_VERSION="18.10"
FROM node:${NODE_VERSION} as base
ARG QWC2_VERSION_HASH="86ba224001cd3c9813ad645f4ccf4de7a17db801"
ARG QWC2_DOWNLOAD_PATH="https://github.com/qgis/qwc2/archive/$QWC2_VERSION_HASH.zip"
ARG QWC2_REPO_VERSION_URL="https://github.com/qgis/qwc2/tree/$QWC2_VERSION_HASH"
RUN apt-get update && apt-get install -y \
bash \
curl && \
curl -L -O $QWC2_DOWNLOAD_PATH && \
unzip $QWC2_VERSION_HASH.zip && \
rm $QWC2_VERSION_HASH.zip && \
mv qwc2-$QWC2_VERSION_HASH /qwc2 && \
echo "$QWC2_VERSION_HASH" > /qwc2/.qwc2.version.txt && \
echo "$QWC2_DOWNLOAD_PATH" > /qwc2/.qwc2.download_source.txt && \
echo "$QWC2_REPO_VERSION_URL" > /qwc2/.qwc2.repo_source.txt
COPY ./app/.yarnrc /qwc2
WORKDIR /qwc2
RUN yarn install
FROM base as dev
ENV DEV_SERVER_PORT=8080
WORKDIR /app
STOPSIGNAL SIGINT
RUN apt-get update && apt-get install -y \
make
CMD ["/usr/bin/make", "clean", "serve-dev"]
#==============
# Stage builder
#==============
FROM dev as builder
COPY ./app /app
WORKDIR /app
RUN /usr/bin/make clean build
#==============
# Stage prod
#==============
FROM nginx:1.23.2 as prod
COPY --from=builder /app/prod /usr/share/nginx/html
COPY ./example_config/config.json ./example_config/themes.json /usr/share/nginx/html/