-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detail tests, app builds in production
- Loading branch information
Crystal Ngai
committed
Feb 25, 2021
1 parent
bbe0b3d
commit ca35d97
Showing
34 changed files
with
749 additions
and
20,906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
unsafe-perm=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v14.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.