Pre-requisite: Have docker and docker-compose installed.
- Clone the repo
git clone [email protected]:covid-group1/covid-backend.git
-
Update the .env variables in the ./server/ directory. (not used now)
-
Build the image
docker build -t template-backend ./server/
- Start the containers
make dev-start
or
docker-compose -f ./server/docker-compose.local.yml up -d
- The API url is
localhost:4000
- To see Mongo admin interface visit
localhost:8081
make dev-stop
or
docker-compose -f ./server/docker-compose.local.yml down
make dev-drop
or
docker-compose -f ./server/docker-compose.local.yml down -v
make dev-runweb CMD="<command>"
or
docker-compose -f ./server/docker-compose.local.yml run web <command>
Example: Add a new dependency
make dev-runweb CMD="yarn add <new_dependency>"
or
docker-compose -f ./server/docker-compose.local.yml run web yarn add <new_dependency>
make dev-rundb CMD="<command>"
or
docker-compose -f ./server/docker-compose.local.yml run db <command?
make dev-logs
or
docker-compose -f ./server/docker-compose.local.yml logs --follow
make test
or
docker-compose -f ./server/docker-compose.local.yml run web yarn test
Ansible configuration:
- Workstation with ansible installed
- ssh access to server (with root) running ubuntu 16.04
cd ./ansible
- run on workstation:
ansible-playbook -i production_server --private-key /path/to/your/root/access/key site.yml