forked from fedspendingtransparency/usaspending-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 1.38 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
FROM node:18.20.4
# Default environment variables
ENV ENV=prod USASPENDING_API=https://api.usaspending.gov/api/ MAPBOX_TOKEN='' GA_TRACKING_ID=''
RUN mkdir /node-workspace && mkdir /test-results
# Copy JUST the package files first.
# This allows Docker to NOT re-fetch all NPM packages if neither of these two files
# have changed, and instead use the cached layer containing all those dependent packages.
# Greatly speeds up repeated docker build calls on the same machine (like CI/CD boxes)
# by leveraging the docker image cache
COPY package.json package-lock.json /node-workspace/
WORKDIR /node-workspace
# DTUI and Usaspending-website have preinstall scripts that run npx npm-force-resolutions
# the command will fail unless specifically pointing to npm-force-resolution@0.0.3
# With the current dependencies we need --legacy-peer-deps in both npm install and ci
# The npm ci will fail without npm install --package-lock-only due to dependency differences
#FE Devs building docker locally may require you to uncomment the next two lines
# RUN npm config set https-proxy "http://p1proxy.frb.org:8080/"
# RUN npm config set proxy "http://p1proxy.frb.org:8080/"
RUN npm install -g npm@9.8.1
RUN npm install -g webpack@5.88.2
RUN npm install -g webpack-cli@5.1.4
RUN npm ci --legacy-peer-deps
# Now copy the remaining source files
# Files in .dockerignore will not be copied
COPY . /node-workspace