-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
chore: allow docker compose to start the backend server (plbstl) #4995
Conversation
name: monkeytype | ||
version: "3.8" | ||
services: | ||
monkeytype-redis: | ||
redis: | ||
container_name: monkeytype-redis | ||
image: redis:6.2.6 |
There was a problem hiding this comment.
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?
My one issue with this PR is that I personally use Docker to only host the databases, and then run the servers in node myself. Maybe we can have one file for just databases and one for databses and node server? |
Yes, that can work. Maybe use the COMPOSE_FILE env var to determine the file to use |
We can't just use multiple files? |
Yes, we're using multiple files. The env var is not necessary but a nice to have. Now thinking about it, it may not even be needed |
I mean multiple files for composing backend:
|
This PR is stale. Please trigger a re-run of the PR check action. |
…into impr/docker-compose-api-server
Let me elaborate on what I meant by this. There will be two docker-compose files in the backend. When someone wants to contribute and they run
We know by default, docker compose checks for |
In that case, i would move the compose files to a |
support server_open env variable
rename file
Description
The Backend section of the Advanced Contribution Guide isn't entirely true. You cannot use
docker compose up
to start the backend server. The command only starts redis and mongodb services, while having to manually run one of the dev scripts to start the backend server.This change makes sure that
docker compose up
in the backend folder also starts the server, making contributions to this project a bit more seamless.I had to use a separate volume for the node_modules in the backend because of mismatch between where the bcrypt module is built (my PC - MacOS) and where it is being run (Docker - Linux). It creates an error that prevents the server from booting up.
Only the backend dependencies are installed and built in the Docker container. The script can be a bit more complicated to skip unnecessary npm installs, but this is also okay.
Checks