-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
36 lines (26 loc) · 1.11 KB
/
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
30
31
32
33
34
35
36
# Ensure updates are mirrored in `.circleci/config.yml`.
# Always specify a 3-part version, even if it's x.x.0.
FROM node:20.13.1
RUN node --version
WORKDIR /usr/src/app
# Do lib metadata copy + install separately, so this part of the build is cached when only app code changes.
# See https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
COPY package*.json ./
# Prepare FontAwesome config for `npm install`.
ARG FONTAWESOME_NPM_AUTH_TOKEN
COPY .npmrc ./
# Skip Puppeteer Chromium download. https://github.com/puppeteer/puppeteer/issues/2262#issuecomment-407405037
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN npm install
# Now copy the app source
COPY . .
# Take value 'regression', 'staging' or 'production' so we know which Angular vars to build into the app bundle.
# This controls e.g. which environment's API we target.
ARG BUILD_ENV
# Build client bundle and prepare for Server-Side Rendering
RUN npm run build:ssr:${BUILD_ENV}
EXPOSE 4000
# Behave like a UK visitor when doing e.g. server-side rendering of Date Pipes.
ENV TZ='Europe/London'
# Serve with Server-Side Rendering support
CMD [ "npm", "run", "serve:ssr" ]