Skip to content

Commit

Permalink
Amend docker setup and add .nvmrc
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-gerlach committed Nov 27, 2023
1 parent ee39006 commit 1ba889b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.20.2
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ COPY . .
# template from akhileshns/heroku-deploy
# 4) collect the arg inside the Dockerfile and pass the arg onto an ENV var (this must happen before the react build
# command as react will include all env vars at build time)
ARG REACT_APP_SESSION_ENCRYPTION_KEY
ARG REACT_APP_CLIENT_HOST
ARG REACT_APP_GOOGLE_MAPS_KEY
ARG REACT_APP_SESSION_ENCRYPTION_KEY
ARG REACT_APP_STRIPE_API_TEST_KEY
ENV REACT_APP_SESSION_ENCRYPTION_KEY $REACT_APP_SESSION_ENCRYPTION_KEY
ENV REACT_APP_CLIENT_HOST $REACT_APP_CLIENT_HOST
ENV REACT_APP_GOOGLE_MAPS_KEY $REACT_APP_GOOGLE_MAPS_KEY
ENV REACT_APP_SESSION_ENCRYPTION_KEY $REACT_APP_SESSION_ENCRYPTION_KEY
ENV REACT_APP_STRIPE_API_TEST_KEY $REACT_APP_STRIPE_API_TEST_KEY

# make React create build directory (app/build) with production build of the app at container compile-time
Expand All @@ -46,9 +48,11 @@ FROM nginx
# https://hub.docker.com/_/nginx
COPY --from=build /app/build /usr/share/nginx/html

ARG REACT_APP_CLIENT_HOST
ARG REACT_APP_SESSION_ENCRYPTION_KEY
ARG REACT_APP_GOOGLE_MAPS_KEY
ARG REACT_APP_STRIPE_API_TEST_KEY
ENV REACT_APP_CLIENT_HOST $REACT_APP_CLIENT_HOST
ENV REACT_APP_SESSION_ENCRYPTION_KEY $REACT_APP_SESSION_ENCRYPTION_KEY
ENV REACT_APP_GOOGLE_MAPS_KEY $REACT_APP_GOOGLE_MAPS_KEY
ENV REACT_APP_STRIPE_API_TEST_KEY $REACT_APP_STRIPE_API_TEST_KEY
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@
6. The app is running on `localhost:3000/`

## Deployment
The app is deployed with AWS Amplify. A CI/CD pipeline has been set up for the main branch such that any change to that branch leads to auto-deployment.

### Render
The app is deployed on [Render](https://secure-my-spot.sigmagamma.app). A CI/CD pipeline has been set up for the main branch such that any change to that branch leads to auto-deployment.

### AWS Amplify
The app used to be deployed on AWS Amplify. A CI/CD pipeline has been set up for the main branch such that any change to that branch leads to auto-deployment.
> **Note**: environment variables (see above) need to be manually sourced from Doppler and entered into the Amplify platform
## Links
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ services:
# Without this env variable hot-reloading will not work
# source: https://mherman.org/blog/dockerizing-a-react-app/
- CHOKIDAR_USEPOLLING="true"
- REACT_APP_CLIENT_HOST=${REACT_APP_CLIENT_HOST}
- REACT_APP_API_HOST=${REACT_APP_API_HOST}
- REACT_APP_GOOGLE_MAPS_KEY=${REACT_APP_GOOGLE_MAPS_KEY}
- REACT_APP_SESSION_ENCRYPTION_KEY=${REACT_APP_SESSION_ENCRYPTION_KEY}
- REACT_APP_STRIPE_API_TEST_KEY=${REACT_APP_STRIPE_API_TEST_KEY}
- REACT_APP_API_HOST=${REACT_APP_API_HOST}

# specify bind-mount volume such that any changes in the host's (build-context) src folder are reflected / replicated
# inside the container -> amendments to the website are immediately reflected in the container, avoiding the need
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
},
"scripts": {
"start": "react-scripts start",
"start:dev": "doppler run -- npm run start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll --testMatch **/src/**/*.tests.js",
"test:coverage": "CI=true react-scripts test --env=jsdom --coverage --testMatch **/src/**/*.tests.js",
Expand Down

0 comments on commit 1ba889b

Please sign in to comment.