forked from Dataport/terminfinder-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (22 loc) · 834 Bytes
/
Dockerfile
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
ARG BASE_REPO_URI=docker.io
FROM ${BASE_REPO_URI}/node:18.19.1-alpine AS build
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Build project
COPY tsconfig.json angular.json prebuild.js ./
COPY src/ ./src/
RUN npm run build-docker-prod
# We use the officially supported unprivileged image from nginx,
# as recommended here: https://hub.docker.com/_/nginx#Running%20nginx%20as%20a%20non-root%20user
FROM ${BASE_REPO_URI}/nginxinc/nginx-unprivileged:1.23.3-alpine
# FROM docker.io/nginxinc/nginx-unprivileged:1.23.3-alpine
WORKDIR /usr/share/nginx/html
# Prepare files
USER 0
COPY docker-replace-parameters.sh /docker-entrypoint.d/60-docker-replace-parameters.sh
COPY --from=build /app/dist /usr/share/nginx/html/.
RUN chown -R 101:101 /usr/share/nginx/html
# Reset to unprivileged
USER 101