From 911ce692e23dff0239a95bc665cc21eaee49a520 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Sun, 10 Dec 2023 13:12:58 -0600 Subject: [PATCH 1/7] #115 Adds Mongo containerization for dev environment --- .gitignore | 1 + CONTRIBUTING.md | 38 +++++++++++++++++++++++++++++++++++--- makefile | 14 ++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 makefile diff --git a/.gitignore b/.gitignore index 7cf4c624..db98ce82 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ docker-compose.yml dump .DS_Store bk +docker/db diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e2ce59a..a37e9953 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,10 +12,42 @@ With Version 2, this Open Source project is now open for contribution! You can h - **Option 2** - 👯 Clone this repo to your local machine using `https://github.com/gitfrosh/lotr-api.git` +### Dependencies + +- install Docker - see [Rancher Desktop](https://rancherdesktop.io/) +- populate the database files locally - from the command line in the project root directory, run: +``` +make mongo-data +``` + +### Quick Start + +- start all services with The One Command: +``` +make up +``` +- stop all services with The (Other) One Command: +``` +make down +``` +- for managing and accessing services individually, continue reading below + ### Start Mongo DB service -- you'll need MongoDB Community Edition running on your machine, listening on default port 27017 -- start a shell and restore LotR data with `mongorestore -d lotr --verbose ./db/bson` +- run a container of the [Mongo docker image](https://hub.docker.com/_/mongo) with the local database files mounted as a volume: +``` +make mongo +``` +- access the mongo command line on the running container: +``` +make mongo-cli +``` +- the database files are stored in `./docker/db/` - to restore from the original, stop any running mongo container, delete that directory, and rerun the data restore command: +``` +make mongo-stop +sudo rm -rf ./docker/db +make mongo-data +``` ### Start Node / Express backend @@ -56,4 +88,4 @@ The API data is far from perfect: There might be spelling mistakes, duplicates, - move into the database folder `cd db/csv` - make your improvements in one of the data CSV files -- 🔃 Create a new pull request using `https://github.com/gitfrosh/lotr-api/compare`. \ No newline at end of file +- 🔃 Create a new pull request using `https://github.com/gitfrosh/lotr-api/compare`. diff --git a/makefile b/makefile new file mode 100644 index 00000000..18e8df91 --- /dev/null +++ b/makefile @@ -0,0 +1,14 @@ +mongo-data: + docker run -v ./db/bson:/var/local -v ./docker/db:/data/db --name lotr_data_restore --rm -d mongo:7.0-jammy + docker exec -it lotr_data_restore mongorestore -d lotr --verbose /var/local + docker container stop lotr_data_restore +mongo: + docker run -v ./docker/db:/data/db -d --rm --name lotr_mongo mongo:7.0-jammy +mongo-cli: + docker exec -it lotr_mongo mongosh "mongodb://localhost:27017/lotr" +mongo-stop: + docker container stop lotr_mongo +up: + make mongo +down: + make mongo-stop From efad9ce286ab723b3a65be045cee4684b86f95f4 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Sun, 10 Dec 2023 15:53:07 -0600 Subject: [PATCH 2/7] #115 Adds backend CLI and server containerization for dev environment --- CONTRIBUTING.md | 27 ++++++++++++++++++++++++--- docker/cli.dockerfile | 20 ++++++++++++++++++++ docker/server.dockerfile | 9 +++++++++ makefile | 13 +++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 docker/cli.dockerfile create mode 100644 docker/server.dockerfile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a37e9953..32ae8159 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,17 @@ With Version 2, this Open Source project is now open for contribution! You can h ``` make mongo-data ``` +- build and run the node command line image to install the backend packages: +``` +make cli-build +make cli +user@abc123:/app$ npm install +user@abc123:/app$ exit +``` +- build the node server image +``` +make server-build +``` ### Quick Start @@ -51,9 +62,19 @@ make mongo-data ### Start Node / Express backend -- move into the backend folder `cd backend` -- install packages with `npm install` -- get your express server started with `node server.js` on localhost:3001 +- run the node server: +``` +make server +``` +- to manage node packages, run the CLI: +``` +make cli +user@abc123:/app$ npm outdated +``` +- if you want to watch the nodemon output as changes are made to application files, follow the container logs: +``` +docker container logs -f lotr_server +``` ### Start React frontend diff --git a/docker/cli.dockerfile b/docker/cli.dockerfile new file mode 100644 index 00000000..45c3e2f3 --- /dev/null +++ b/docker/cli.dockerfile @@ -0,0 +1,20 @@ +# Using the debian version rather than alpine, cuz bash and stuff +FROM node:21.2 + +WORKDIR /app + +# Configure the user's id and group id to match the host file system +RUN userdel -r node + +ARG USER_ID + +ARG GROUP_ID + +RUN getent group $GROUP_ID || addgroup --gid $GROUP_ID user + +RUN getent passwd $USER_ID || adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user + +# Set the active user and open the interactive terminal +USER user + +ENTRYPOINT [ "bash" ] diff --git a/docker/server.dockerfile b/docker/server.dockerfile new file mode 100644 index 00000000..c5b7c273 --- /dev/null +++ b/docker/server.dockerfile @@ -0,0 +1,9 @@ +FROM node:21.2-alpine + +WORKDIR /app + +RUN npm install -g nodemon + +EXPOSE 3001 + +CMD [ "npm", "run", "dev" ] diff --git a/makefile b/makefile index 18e8df91..232260ca 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,20 @@ mongo-cli: docker exec -it lotr_mongo mongosh "mongodb://localhost:27017/lotr" mongo-stop: docker container stop lotr_mongo + +cli-build: + docker build --build-arg "USER_ID=$$(id -u)" --build-arg "GROUP_ID=$$(id -g)" -t lotr_cli:1.0.0 - < ./docker/cli.dockerfile +cli: + docker run -v ./backend:/app -it --rm --name lotr_cli lotr_cli:1.0.0 + +server-build: + docker build -f ./docker/server.dockerfile -t lotr_server:1.0.0 backend +server: + docker run -v ./backend:/app -p 3001:3001 -d --rm --name lotr_server lotr_server:1.0.0 + up: make mongo + make server down: + docker container stop lotr_server make mongo-stop From 93facc4089ed69bb8373fcf5c0217fb376be1336 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Mon, 11 Dec 2023 16:14:47 -0600 Subject: [PATCH 3/7] #115 Adds frontend React containerization for dev environment --- CONTRIBUTING.md | 36 ++++++++++++++----- .../{server.dockerfile => backend.dockerfile} | 0 docker/frontend.dockerfile | 7 ++++ makefile | 17 +++++++-- 4 files changed, 49 insertions(+), 11 deletions(-) rename docker/{server.dockerfile => backend.dockerfile} (100%) create mode 100644 docker/frontend.dockerfile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32ae8159..828defe5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,12 +19,15 @@ With Version 2, this Open Source project is now open for contribution! You can h ``` make mongo-data ``` -- build and run the node command line image to install the backend packages: +- build and run the node command line image to install the packages for both the backend and frontend apps: ``` make cli-build make cli -user@abc123:/app$ npm install -user@abc123:/app$ exit +user@abc123:/app$ cd backend +user@abc123:/app/backend$ npm install +user@abc123:/app/backend$ cd ../frontend +user@abc123:/app/frontend$ npm install +user@abc123:/app/frontend$ exit ``` - build the node server image ``` @@ -69,7 +72,8 @@ make server - to manage node packages, run the CLI: ``` make cli -user@abc123:/app$ npm outdated +user@abc123:/app$ cd backend +user@abc123:/app/backend$ npm outdated ``` - if you want to watch the nodemon output as changes are made to application files, follow the container logs: ``` @@ -78,9 +82,20 @@ docker container logs -f lotr_server ### Start React frontend -- move into the frontend folder `cd frontend` -- install packages with `npm install` -- get your development server started with `npm start` on localhost:3000 +- run the app service: +``` +make app +``` +- to manage node packages, run the CLI: +``` +make cli +user@abc123:/app$ cd frontend +user@abc123:/app/frontend$ npm outdated +``` +- if you want to watch the webpack output as changes are made to application files, follow the container logs: +``` +docker container logs -f lotr_app +``` ### Create a user - navigate to http://localhost:3000 and sign up @@ -89,7 +104,12 @@ docker container logs -f lotr_server ### Running tests -- navigate to the specific project (*backend* or *frontend*) and execute `npm test`. +- run the CLI, navigate to the specific project (*backend* or *frontend*), and execute `npm test`: +``` +make cli +user@abc123:/app$ cd backend +user@abc123:/app/backend$ npm test +``` ### **HACK AWAY!** 🔨🔨🔨 diff --git a/docker/server.dockerfile b/docker/backend.dockerfile similarity index 100% rename from docker/server.dockerfile rename to docker/backend.dockerfile diff --git a/docker/frontend.dockerfile b/docker/frontend.dockerfile new file mode 100644 index 00000000..fadb12dd --- /dev/null +++ b/docker/frontend.dockerfile @@ -0,0 +1,7 @@ +FROM node:21.2-alpine + +WORKDIR /app + +EXPOSE 3000 + +CMD [ "npm", "run", "start" ] diff --git a/makefile b/makefile index 232260ca..db2d5465 100644 --- a/makefile +++ b/makefile @@ -12,16 +12,27 @@ mongo-stop: cli-build: docker build --build-arg "USER_ID=$$(id -u)" --build-arg "GROUP_ID=$$(id -g)" -t lotr_cli:1.0.0 - < ./docker/cli.dockerfile cli: - docker run -v ./backend:/app -it --rm --name lotr_cli lotr_cli:1.0.0 + docker run -v ./backend:/app/backend -v ./frontend:/app/frontend -it --rm --name lotr_cli lotr_cli:1.0.0 server-build: - docker build -f ./docker/server.dockerfile -t lotr_server:1.0.0 backend + docker build -f ./docker/backend.dockerfile -t lotr_server:1.0.0 backend server: docker run -v ./backend:/app -p 3001:3001 -d --rm --name lotr_server lotr_server:1.0.0 +server-stop: + docker container stop lotr_server + +app-build: + docker build -f ./docker/frontend.dockerfile -t lotr_app:1.0.0 frontend +app: + docker run -v ./frontend:/app -p 3000:3000 -d --rm --name lotr_app lotr_app:1.0.0 +app-stop: + docker container stop lotr_app up: make mongo make server + make app down: - docker container stop lotr_server + make app-stop + make server-stop make mongo-stop From 2fda0af7b3c7478054965b6b9abe65ed1b417380 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Wed, 13 Dec 2023 18:07:44 -0600 Subject: [PATCH 4/7] #115 Moves contianer builds from make commands to docker compose --- CONTRIBUTING.md | 51 ++++++++------------------- docker/backend.dockerfile | 9 ----- docker/compose.yml | 38 ++++++++++++++++++++ docker/{cli.dockerfile => dockerfile} | 22 +++++++++++- docker/frontend.dockerfile | 7 ---- docker/npm-build.sh | 8 +++++ makefile | 46 ++++++------------------ 7 files changed, 92 insertions(+), 89 deletions(-) delete mode 100644 docker/backend.dockerfile create mode 100644 docker/compose.yml rename docker/{cli.dockerfile => dockerfile} (56%) delete mode 100644 docker/frontend.dockerfile create mode 100644 docker/npm-build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 828defe5..269c10c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,23 +15,9 @@ With Version 2, this Open Source project is now open for contribution! You can h ### Dependencies - install Docker - see [Rancher Desktop](https://rancherdesktop.io/) -- populate the database files locally - from the command line in the project root directory, run: +- build and run the node command line image, which will automatically install the packages for both the backend and frontend apps: ``` -make mongo-data -``` -- build and run the node command line image to install the packages for both the backend and frontend apps: -``` -make cli-build -make cli -user@abc123:/app$ cd backend -user@abc123:/app/backend$ npm install -user@abc123:/app/backend$ cd ../frontend -user@abc123:/app/frontend$ npm install -user@abc123:/app/frontend$ exit -``` -- build the node server image -``` -make server-build +make build ``` ### Quick Start @@ -46,29 +32,23 @@ make down ``` - for managing and accessing services individually, continue reading below -### Start Mongo DB service +### Mongo DB service -- run a container of the [Mongo docker image](https://hub.docker.com/_/mongo) with the local database files mounted as a volume: -``` -make mongo -``` - access the mongo command line on the running container: ``` -make mongo-cli +docker exec -it lotr-mongo-1 mongosh +test> use lotr +lotr> ``` -- the database files are stored in `./docker/db/` - to restore from the original, stop any running mongo container, delete that directory, and rerun the data restore command: +- the database files are stored in `./docker/db/` - to restore from the original, stop the running containers, delete that directory, and bring the environment back up: ``` -make mongo-stop +make down sudo rm -rf ./docker/db -make mongo-data +make up ``` -### Start Node / Express backend +### Node / Express backend -- run the node server: -``` -make server -``` - to manage node packages, run the CLI: ``` make cli @@ -77,15 +57,11 @@ user@abc123:/app/backend$ npm outdated ``` - if you want to watch the nodemon output as changes are made to application files, follow the container logs: ``` -docker container logs -f lotr_server +docker container logs -f lotr-backend-1 ``` -### Start React frontend +### React frontend -- run the app service: -``` -make app -``` - to manage node packages, run the CLI: ``` make cli @@ -98,6 +74,7 @@ docker container logs -f lotr_app ``` ### Create a user + - navigate to http://localhost:3000 and sign up - use your favorite Mongo client to access user documents and get your new access_token for using the secured APIs - OR login with your credentials in the Frontend to get your token @@ -114,8 +91,8 @@ user@abc123:/app/backend$ npm test ### **HACK AWAY!** 🔨🔨🔨 ### 🔃 Create a new pull request -- using `https://github.com/gitfrosh/lotr-api/compare`. +- using `https://github.com/gitfrosh/lotr-api/compare`. ## Getting started with Data Improvement / Enhancement diff --git a/docker/backend.dockerfile b/docker/backend.dockerfile deleted file mode 100644 index c5b7c273..00000000 --- a/docker/backend.dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM node:21.2-alpine - -WORKDIR /app - -RUN npm install -g nodemon - -EXPOSE 3001 - -CMD [ "npm", "run", "dev" ] diff --git a/docker/compose.yml b/docker/compose.yml new file mode 100644 index 00000000..0094173a --- /dev/null +++ b/docker/compose.yml @@ -0,0 +1,38 @@ +name: lotr +services: + mongo: + build: + context: .. + dockerfile: docker/dockerfile + target: lotr_mongo + environment: + MONGO_INITDB_DATABASE: lotr + ports: + - 27017:27017 + restart: on-failure + volumes: + - ./db:/data/db + + backend: + image: node:21.2-alpine + command: [ "npm", "run", "dev" ] + depends_on: + - mongo + environment: + DATABASE_URL: "mongodb://mongo:27017/lotr" + ports: + - 3001:3001 + volumes: + - ../backend:/app + working_dir: /app + + frontend: + image: node:21.2-alpine + command: [ "npm", "run", "start" ] + depends_on: + - backend + ports: + - 3000:3000 + volumes: + - ../frontend:/app + working_dir: /app diff --git a/docker/cli.dockerfile b/docker/dockerfile similarity index 56% rename from docker/cli.dockerfile rename to docker/dockerfile index 45c3e2f3..b6cd4966 100644 --- a/docker/cli.dockerfile +++ b/docker/dockerfile @@ -1,8 +1,16 @@ +#################### +### COMMAND LINE ### +#################### + # Using the debian version rather than alpine, cuz bash and stuff -FROM node:21.2 +FROM node:21.2 as lotr_cli WORKDIR /app +COPY ./docker/npm-build.sh . + +RUN chmod +x npm-build.sh + # Configure the user's id and group id to match the host file system RUN userdel -r node @@ -18,3 +26,15 @@ RUN getent passwd $USER_ID || adduser --disabled-password --gecos '' --uid $USER USER user ENTRYPOINT [ "bash" ] + + + +################ +### DATABASE ### +################ + +FROM mongo:7.0-jammy as lotr_mongo + +COPY ./db/bson /data/init + +RUN echo "mongorestore --archive='/data/init'" > /docker-entrypoint-initdb.d/init.sh diff --git a/docker/frontend.dockerfile b/docker/frontend.dockerfile deleted file mode 100644 index fadb12dd..00000000 --- a/docker/frontend.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM node:21.2-alpine - -WORKDIR /app - -EXPOSE 3000 - -CMD [ "npm", "run", "start" ] diff --git a/docker/npm-build.sh b/docker/npm-build.sh new file mode 100644 index 00000000..7d9074cd --- /dev/null +++ b/docker/npm-build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# this file is copied into the CLI image to automate installing node dependencies + +cd backend +npm install --include=dev +cd ../frontend +npm install --include=dev diff --git a/makefile b/makefile index db2d5465..930bae13 100644 --- a/makefile +++ b/makefile @@ -1,38 +1,14 @@ -mongo-data: - docker run -v ./db/bson:/var/local -v ./docker/db:/data/db --name lotr_data_restore --rm -d mongo:7.0-jammy - docker exec -it lotr_data_restore mongorestore -d lotr --verbose /var/local - docker container stop lotr_data_restore -mongo: - docker run -v ./docker/db:/data/db -d --rm --name lotr_mongo mongo:7.0-jammy -mongo-cli: - docker exec -it lotr_mongo mongosh "mongodb://localhost:27017/lotr" -mongo-stop: - docker container stop lotr_mongo - -cli-build: - docker build --build-arg "USER_ID=$$(id -u)" --build-arg "GROUP_ID=$$(id -g)" -t lotr_cli:1.0.0 - < ./docker/cli.dockerfile -cli: - docker run -v ./backend:/app/backend -v ./frontend:/app/frontend -it --rm --name lotr_cli lotr_cli:1.0.0 - -server-build: - docker build -f ./docker/backend.dockerfile -t lotr_server:1.0.0 backend -server: - docker run -v ./backend:/app -p 3001:3001 -d --rm --name lotr_server lotr_server:1.0.0 -server-stop: - docker container stop lotr_server - -app-build: - docker build -f ./docker/frontend.dockerfile -t lotr_app:1.0.0 frontend -app: - docker run -v ./frontend:/app -p 3000:3000 -d --rm --name lotr_app lotr_app:1.0.0 -app-stop: - docker container stop lotr_app +# build the command line interface and install node packages +build: + docker build --build-arg "USER_ID=$$(id -u)" --build-arg "GROUP_ID=$$(id -g)" -f ./docker/dockerfile --target lotr_cli -t lotr-cli:latest . + docker run -v ./backend:/app/backend -v ./frontend:/app/frontend --entrypoint /app/npm-build.sh -it --rm --name lotr-cli lotr-cli +# start and stop the local environment up: - make mongo - make server - make app + docker compose -f docker/compose.yml up -d down: - make app-stop - make server-stop - make mongo-stop + docker compose -f docker/compose.yml down + +# run the command line interface to manage application dependencies and run tests +cli: + docker run -v ./backend:/app/backend -v ./frontend:/app/frontend -it --rm --name lotr-cli lotr-cli From 9dddb656642bc774936e19cd8189433ca1947d70 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Wed, 13 Dec 2023 18:13:08 -0600 Subject: [PATCH 5/7] #115 Fixes container name referenced in contributing doc --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 269c10c2..bf4b6602 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,7 @@ user@abc123:/app/frontend$ npm outdated ``` - if you want to watch the webpack output as changes are made to application files, follow the container logs: ``` -docker container logs -f lotr_app +docker container logs -f lotr-frontend-1 ``` ### Create a user From 233a1bbdfd43b337faff17c005b7ef64e1eb6f96 Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Thu, 14 Dec 2023 14:39:33 -0600 Subject: [PATCH 6/7] #115 Improves docker installation notes --- CONTRIBUTING.md | 95 ++++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf4b6602..2edb66d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,64 +14,77 @@ With Version 2, this Open Source project is now open for contribution! You can h ### Dependencies -- install Docker - see [Rancher Desktop](https://rancherdesktop.io/) +- install Docker + - if running on Linux, follow [the install instructions for your distro](https://docs.docker.com/engine/install/#supported-platforms) + - otherwise, see [Rancher Desktop](https://rancherdesktop.io/) + - if running Rancher Desktop on Windows, after installing go to **File → Preferences → WSL → Integrations** and check the "**Ubuntu**" box - build and run the node command line image, which will automatically install the packages for both the backend and frontend apps: -``` -make build -``` + ``` + make build + ``` + - if you get an error like this: + ``` + ERROR: failed to solve: error getting credentials - err: exit status 127, out: `` + ``` + - create / log into your account on [dockerhub](https://hub.docker.com) + - create a new [Access Token](https://hub.docker.com/settings/security) + - log in on the command line with your usernamne and the access token as your password: + ``` + docker login + ``` ### Quick Start - start all services with The One Command: -``` -make up -``` + ``` + make up + ``` - stop all services with The (Other) One Command: -``` -make down -``` + ``` + make down + ``` - for managing and accessing services individually, continue reading below ### Mongo DB service - access the mongo command line on the running container: -``` -docker exec -it lotr-mongo-1 mongosh -test> use lotr -lotr> -``` + ``` + docker exec -it lotr-mongo-1 mongosh + test> use lotr + lotr> + ``` - the database files are stored in `./docker/db/` - to restore from the original, stop the running containers, delete that directory, and bring the environment back up: -``` -make down -sudo rm -rf ./docker/db -make up -``` + ``` + make down + sudo rm -rf ./docker/db + make up + ``` ### Node / Express backend - to manage node packages, run the CLI: -``` -make cli -user@abc123:/app$ cd backend -user@abc123:/app/backend$ npm outdated -``` + ``` + make cli + user@abc123:/app$ cd backend + user@abc123:/app/backend$ npm outdated + ``` - if you want to watch the nodemon output as changes are made to application files, follow the container logs: -``` -docker container logs -f lotr-backend-1 -``` + ``` + docker container logs -f lotr-backend-1 + ``` ### React frontend - to manage node packages, run the CLI: -``` -make cli -user@abc123:/app$ cd frontend -user@abc123:/app/frontend$ npm outdated -``` + ``` + make cli + user@abc123:/app$ cd frontend + user@abc123:/app/frontend$ npm outdated + ``` - if you want to watch the webpack output as changes are made to application files, follow the container logs: -``` -docker container logs -f lotr-frontend-1 -``` + ``` + docker container logs -f lotr-frontend-1 + ``` ### Create a user @@ -82,11 +95,11 @@ docker container logs -f lotr-frontend-1 ### Running tests - run the CLI, navigate to the specific project (*backend* or *frontend*), and execute `npm test`: -``` -make cli -user@abc123:/app$ cd backend -user@abc123:/app/backend$ npm test -``` + ``` + make cli + user@abc123:/app$ cd backend + user@abc123:/app/backend$ npm test + ``` ### **HACK AWAY!** 🔨🔨🔨 From 6a20401074bb8bfeab28006c604d0c0c0984932b Mon Sep 17 00:00:00 2001 From: "Israel J. Carberry" Date: Fri, 15 Dec 2023 13:48:44 -0600 Subject: [PATCH 7/7] #115 Updates backend container image to support bcrypt binary execution --- docker/compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/compose.yml b/docker/compose.yml index 0094173a..537bd989 100644 --- a/docker/compose.yml +++ b/docker/compose.yml @@ -14,7 +14,8 @@ services: - ./db:/data/db backend: - image: node:21.2-alpine + # Using the debian version rather than alpine to support binary execution e.g. bcrypt + image: node:21.2 command: [ "npm", "run", "dev" ] depends_on: - mongo