-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (21 loc) · 840 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
29
FROM node:22-alpine AS builder
LABEL maintainer="[email protected]"
# Install dependencies first so they layer can be cached across builds.
RUN mkdir /app
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm i
# Build
COPY . .
RUN npm run ng build --production
# -- --prod
FROM nginx:stable-alpine
# We need to make a few changes to the default configuration file.
COPY nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx/html
# Remove any default nginx content
RUN rm -rf *
# Copy build from "builder" stage, as well as runtime configuration script public folder
COPY --from=builder /app/dist/knartwork .
# CMD ["./configure-from-environment.sh", "&&", "exec", "nginx", "-g", "'daemon off;'"]
CMD envsubst < assets/configuration.template.js > assets/configuration.js && exec nginx -g 'daemon off;'