File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 1- FROM node:23-alpine AS builder
1+ FROM node:23-alpine AS localBuilder
22
33WORKDIR /usr/src/app
44
@@ -20,10 +20,40 @@ COPY . .
2020
2121RUN nx build --skip-nx-cache --prod
2222
23- FROM nginx:stable-alpine AS production
23+ FROM node:23-alpine AS githubBuilder
24+
25+ WORKDIR /usr/src/app
26+
27+ ARG MAPILLARY_URL
28+
29+ RUN --mount=type=secret,id=simra_api_url \
30+ --mount=type=secret,id=mapillary_access_token \
31+ export SIMRA_API_URL=$(cat /run/secrets/simra_api_url 2>/dev/null || echo "" ) && \
32+ export MAPILLARY_ACCESS_TOKEN=$(cat /run/secrets/mapillary_access_token 2>/dev/null || echo "" ) && \
33+ export MAPILLARY_URL=$MAPILLARY_URL && \
34+ export NX_DAEMON=false && \
35+ npm install -g nx && \
36+ npm ci --ignore-scripts
37+
38+ COPY package*.json ./
39+
40+ RUN npm ci --ignore-scripts
41+ RUN npm install -g nx
42+
43+ COPY . .
44+
45+ RUN nx build --skip-nx-cache --prod
46+
47+ FROM nginx:stable-alpine AS localProduction
2448
2549COPY ./nginx.conf /etc/nginx/conf.d/default.conf
26- COPY --from=builder /usr/src/app/dist/simra/browser /usr/share/nginx/html
50+ COPY --from=localBuilder /usr/src/app/dist/simra/browser /usr/share/nginx/html
2751
2852EXPOSE 80
2953
54+ FROM nginx:stable-alpine AS githubProduction
55+
56+ COPY ./nginx.conf /etc/nginx/conf.d/default.conf
57+ COPY --from=githubBuilder /usr/src/app/dist/simra/browser /usr/share/nginx/html
58+
59+ EXPOSE 80
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ services:
77 pull_policy : always
88 build :
99 context : .
10+ target : localProduction
1011 dockerfile : Dockerfile
1112 args :
1213 SIMRA_API_URL : ${SIMRA_API_URL}
You can’t perform that action at this time.
0 commit comments