Skip to content

Commit

Permalink
Detail tests, app builds in production
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal Ngai committed Feb 25, 2021
1 parent bbe0b3d commit ca35d97
Show file tree
Hide file tree
Showing 34 changed files with 749 additions and 20,906 deletions.
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
unsafe-perm=true

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.9.0
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# build environment
FROM node:14.6.0-alpine as builder

RUN apk update
RUN apk add git

# we first copy just the package.json and run npm ci
# to take advantage of layer caching
ENV NPM_CONFIG_LOGLEVEL=warn
COPY package*.json ./
COPY .npmrc ./
COPY install-deps.sh ./
# conditionally login to github package registry
# and install dependencies
ARG github_token=""
RUN chmod +x ./install-deps.sh
RUN sh ./install-deps.sh

# then copy the rest of the files
COPY . ./

# Set some standard ENV
ENV PORT=3000 \
NODE_ENV=production
EXPOSE $PORT

# CMD will set the default command that
# is run when running the docker container.
# In this case, we run build-and-start to
# build the app with our env vars, delete
# unnecessary files, and start the app.
CMD npm run build-and-start
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "2.2"
services:
sfr-front-end:
container_name: sfr-front-end
build: ./
environment:
NODE_ENV: production
ports:
- 3000:3000
Loading

0 comments on commit ca35d97

Please sign in to comment.