-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (37 loc) · 1.49 KB
/
Dockerfile
File metadata and controls
58 lines (37 loc) · 1.49 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
# =======================================================
FROM registry.access.redhat.com/ubi9/nodejs-22 AS appbase
# =======================================================
USER root
WORKDIR /app
RUN yum update -y && yum install -y bzip2 && yum clean all
COPY package.json .
RUN npm install
# =======================================================
FROM appbase AS development
# =======================================================
ARG API_URL=https://palvelukartta.api.test.hel.ninja/v2
ENV API_URL $API_URL
COPY . .
EXPOSE 8001
CMD ["npm", "start"]
# =======================================================
FROM appbase AS staticbuilder
# =======================================================
ARG API_URL=https://api.hel.fi/servicemap/v2
ENV API_URL $API_URL
COPY --chown=root:root . .
RUN npm install -D webpack-cli && npm run dist
# =======================================================
FROM registry.access.redhat.com/ubi9/nginx-122 AS production
# =======================================================
# Add application sources to a directory that the assemble script expects them
# and set permissions so that the container runs without root access
USER root
RUN chgrp -R 0 /usr/share/nginx/html && \
chmod -R g=u /usr/share/nginx/html
COPY --from=staticbuilder /app/dist /usr/share/nginx/html
COPY nginx.conf /opt/app-root/etc/nginx.default.d/default.conf
USER 1001
EXPOSE 8080
# Run script uses standard ways to run the application
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]