forked from equinor/flotilla
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 651 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (21 loc) · 651 Bytes
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
FROM node:lts-alpine AS build
RUN corepack enable
WORKDIR /app
COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm build
FROM nginxinc/nginx-unprivileged:1.27-alpine
WORKDIR /app
COPY --from=build /app/dist /app
COPY nginx.conf /etc/nginx/conf.d/default.conf
# The nginx script substitutes the global variables in 'index.html' with the current environment variables when executed
COPY run_nginx.sh run_nginx.sh
EXPOSE 3001
# Switch to admin to change permissions
USER 0
RUN chown -R nginx /etc/nginx/conf.d \
&& chown -R nginx /app \
&& chmod +x run_nginx.sh
# Switch back to unpriviliged
USER 101
CMD /bin/sh -c ". run_nginx.sh"