FIT3170-FY-Project-7 / RABIT-COMMON

Common repository of the RABIT project, for documentation storage and cross-component interaction.
https://rabit2022.cloud.edu.au/plots
ISC License
3 stars 1 forks source link

Add docker-compose config only for database #27

Closed megascrapper closed 1 year ago

megascrapper commented 1 year ago

📋 | Pre-PR

Before submitting a pull request make sure you have:


📄 | Licensing

In order to be accepted and merged into RABIT, each piece of code must be released under ISC license or a compatible license.

Check one of the following options:


ℹī¸ | Description / Further Information

Explanation of the purpose and effect of your pull request goes here.

Provide context and examples as necessary.

Add a docker-compose config that will deploy the db container for those who want to use npm run start on frontend and backend but don't want to go through setting up MySQL.

It's very important to pass -f db-docker-compose.yml when you want to deploy just db as it otherwise defaults to reading docker-compose.yml which will deploy the whole stack.

On the backend, DB_HOST environment variable must be set to localhost as technically the db container is exposing the conection to localhost, and if we put db then it will look at connection on hostname db and you'll get getaddrinfo ENOTFOUND db.