Skip to content

Commit 79845ad

Browse files
committed
fix: pipeline
1 parent 116cb24 commit 79845ad

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

Dockerfile

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:23-alpine AS builder
1+
FROM node:23-alpine AS localBuilder
22

33
WORKDIR /usr/src/app
44

@@ -20,10 +20,40 @@ COPY . .
2020

2121
RUN 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

2549
COPY ./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

2852
EXPOSE 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

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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}

0 commit comments

Comments
 (0)