Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow docker compose to start the backend server (plbstl) #4995

Merged
merged 16 commits into from
Feb 28, 2024
Merged
21 changes: 19 additions & 2 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: monkeytype
version: "3.8"
services:
monkeytype-redis:
redis:
container_name: monkeytype-redis
image: redis:6.2.6
Comment on lines +1 to 6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the difference between the two?

ports:
Expand All @@ -9,7 +10,7 @@ services:
volumes:
- redis-data:/data

monkeytype-mongodb:
mongodb:
container_name: monkeytype-mongodb
image: mongo:5.0.8
restart: on-failure
Expand All @@ -18,6 +19,22 @@ services:
ports:
- "${DOCKER_DB_PORT:-27017}:${DOCKER_DB_PORT:-27017}"

api-server:
container_name: monkeytype-api-server
image: node:18.17.1
restart: on-failure
depends_on:
- redis
- mongodb
environment:
- DB_URI=mongodb://mongodb:27017
ports:
- "${DOCKER_SERVER_PORT:-5005}:${DOCKER_SERVER_PORT:-5005}"
volumes:
- ../:/monkeytype
- /monkeytype/backend/node_modules
entrypoint: 'bash -c "cd /monkeytype/backend && npm install && npm run dev"'

volumes:
mongo-data:
redis-data:
3 changes: 2 additions & 1 deletion backend/example.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DB_NAME=monkeytype
DOCKER_SERVER_PORT=5005
Miodec marked this conversation as resolved.
Show resolved Hide resolved
DOCKER_DB_PORT=27017
DB_URI=mongodb://localhost:27017
DOCKER_REDIS_PORT=6379
Expand All @@ -16,7 +17,7 @@ MODE=dev

# You can get a testing email address over at
# https://ethereal.email/create
#
#
# EMAIL_PORT=587
# EMAIL_HOST=smtp.ethereal.email
# EMAIL_USER=
Expand Down
5 changes: 3 additions & 2 deletions frontend/docker-compose.yaml → frontend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: monkeytype
services:
monkeytype-frontend:
frontend:
container_name: monkeytype-frontend
image: node:gallium-bullseye
image: node:18.17.1
restart: on-failure
ports:
- "3000:3000"
Expand Down
Loading