Repository navigation
Expand file tree
/
Copy pathdockerfile
More file actions
92 lines (49 loc) · 1.46 KB
/
Copy pathdockerfile
File metadata and controls
92 lines (49 loc) · 1.46 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
87
88
89
90
91
92
ARG CI_PROJECT_URL=''
ARG CI_COMMIT_SHA=''
ARG CI_COMMIT_TAG=''
ARG ALPINE_VERSION=3.24
ARG NGINX_VERSION=1.31.3
ARG NODE_VERSION=24
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} as build
COPY . /workdir
WORKDIR /workdir
RUN uname -m
RUN node --version
RUN node -e "console.log(process.arch); console.log(process.platform)"
RUN npm --version
RUN npm ci --foreground-scripts
RUN npm run build
FROM nginx:${NGINX_VERSION}-alpine${ALPINE_VERSION}-slim AS prepare
COPY --from=build /workdir/build/ /usr/share/nginx/html/
COPY includes/ /
RUN apk update --no-cache; \
apk upgrade --no-cache; \
apk add --no-cache \
supervisor; \
rm -f /etc/supervisord.conf; \
chmod +x /entrypoint.sh
# Clean-up
RUN \
rm -f \
$(which apk) \
$(which wget);
FROM scratch
LABEL \
org.opencontainers.image.vendor="No Fuss Computing" \
org.opencontainers.image.title="Centurion ERP UI" \
org.opencontainers.image.description="An automagic react UI." \
io.artifacthub.package.license="AGPL-3.0-ONLY"
ARG CI_PROJECT_URL
ARG CI_COMMIT_SHA
ARG CI_COMMIT_TAG
ENV CI_PROJECT_URL=${CI_PROJECT_URL}
ENV CI_COMMIT_SHA=${CI_COMMIT_SHA}
ENV CI_COMMIT_TAG=${CI_COMMIT_TAG}
ENV API_URL="http://127.0.0.1:3000/mock/api/v2"
COPY --from=prepare / /
WORKDIR /var/log
EXPOSE 80
VOLUME [ "/var/log" ]
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD \
supervisorctl status || exit 1
ENTRYPOINT [ "/entrypoint.sh" ]