Skip to content

Commit

Permalink
Merge pull request #290 from swisstopo/fix/security-hotspots
Browse files Browse the repository at this point in the history
Fix: Security Hotspots
  • Loading branch information
daniel-va authored Oct 16, 2024
2 parents a37e7b3 + b31396d commit 4430a41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/client-asset-sg/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add python3 make gcc g++
WORKDIR /app
COPY . .

RUN npm install
RUN npm install --no-scripts
RUN sed -i ''s/0.0.0-local/${APP_VERSION}/g'' apps/client-asset-sg/src/assets/version.json
RUN npx nx build client-asset-sg --configuration=production

Expand Down
7 changes: 6 additions & 1 deletion apps/pipeline-asset-sg/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV NODE_ENV=development
WORKDIR /app
COPY . .

RUN npm install
RUN npm install --no-scripts
RUN npx nx build pipeline-asset-sg --configuration=production

# final image build
Expand All @@ -21,4 +21,9 @@ WORKDIR /app
COPY --from=pipeline-builder /app/dist/apps/pipeline-asset-sg .
COPY --from=pipeline-builder /app/node_modules ./node_modules

RUN addgroup -S app \
&& adduser -S app -G app \
&& chown -R app:app /app
USER app

CMD ["node", "main.js"]
7 changes: 6 additions & 1 deletion apps/server-asset-sg/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV NODE_ENV=development
WORKDIR /app
COPY . .

RUN npm install
RUN npm install --no-scripts
RUN npx nx build server-asset-sg --configuration=production

# final image build
Expand All @@ -23,5 +23,10 @@ COPY --from=api-builder /app/node_modules ./node_modules
COPY apps/server-asset-sg/docker/start.sh start.sh
RUN chmod +x start.sh

RUN addgroup -S app \
&& adduser -S app -G app \
&& chown -R app:app /app
USER app

ENTRYPOINT ["sh"]
CMD ["start.sh"]

0 comments on commit 4430a41

Please sign in to comment.