-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impr(dev): allow docker compose to start the backend server (plbstl, …
…Miodec) (#4995) * chore: allow backend docker compose to start the api-server alongside redis & mongodb * chore: update node versions in docker compose * chore: add an extra compose file in backend * docs: update advanced contribution guide with docker compose changes * add docker script support server_open env variable * move files * npm scripts rename file * add docker ignore * fix redis not working * rename file * mounting root instead * update docs * update docs table of contents * restart on fail --------- Co-authored-by: Miodec <jack@monkeytype.com>
- Loading branch information
Showing
10 changed files
with
130 additions
and
65 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
frontend/node_modules | ||
backend/node_modules |
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
11 changes: 6 additions & 5 deletions
11
backend/docker-compose.yml → backend/docker/compose.db-only.yml
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
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,40 @@ | ||
name: monkeytype | ||
version: "3.8" | ||
services: | ||
redis: | ||
container_name: monkeytype-redis | ||
image: redis:6.2.6 | ||
restart: on-failure | ||
ports: | ||
- "${DOCKER_REDIS_PORT:-6379}:${DOCKER_REDIS_PORT:-6379}" | ||
volumes: | ||
- redis-data:/data | ||
|
||
mongodb: | ||
container_name: monkeytype-mongodb | ||
image: mongo:5.0.8 | ||
restart: on-failure | ||
ports: | ||
- "${DOCKER_DB_PORT:-27017}:${DOCKER_DB_PORT:-27017}" | ||
volumes: | ||
- mongo-data:/data/db | ||
|
||
api-server: | ||
container_name: monkeytype-api-server | ||
image: node:18.19.1 | ||
restart: on-failure | ||
depends_on: | ||
- redis | ||
- mongodb | ||
environment: | ||
- DB_URI=mongodb://mongodb:27017 | ||
- REDIS_URI=redis://redis:6379 | ||
ports: | ||
- "${DOCKER_SERVER_PORT:-5005}:${DOCKER_SERVER_PORT:-5005}" | ||
volumes: | ||
- ../../:/monkeytype | ||
entrypoint: 'bash -c "cd /monkeytype/backend && npm install && npm run dev"' | ||
|
||
volumes: | ||
mongo-data: | ||
redis-data: |
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
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
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
name: monkeytype | ||
services: | ||
frontend: | ||
container_name: monkeytype-frontend | ||
image: node:18.19.1 | ||
# restart: on-failure | ||
environment: | ||
- SERVER_OPEN=false | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- ../../:/monkeytype | ||
user: node | ||
entrypoint: 'bash -c "cd /monkeytype/frontend && npm i && npm run dev"' | ||
# entrypoint: "tail -f /dev/null" |
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
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