Development docker image supports live reload
env variables located right in compose file docker-compose.dev.yml
Run to get started:
docker-compose -f docker-compose.dev.yml up -d
To rebuild the image and run it:
docker-compose -f docker-compose.dev.yml up -d --build
To enter in the attach mode enter:
docker attach <hawk_api_container_name>
To exit the attach mode enter the following combination: ctrl+p ctrl+q
Copy .env.sample
to .env
NODE_ENV
is set to production
devDependencies
are not downloaded
Run to get started:
docker-compose -f docker-compose.prod.yml up -d
To rebuild the image and run it:
docker-compose -f docker-compose.prod.yml up -d --build
MongoDB container data is stored in mongodata
volume
Run this to delete volume and containers:
docker-compose -f docker-compose.{dev,prod}.yml down
If you want to remove dangling volume run:
docker volume ls | grep mongodata | awk '{print $2}' | xargs docker volume rm
To run migrations for MongoDB run following command:
docker-compose exec api yarn migrate-mongo up
This command will apply all pending migrations. See migrate-mongo
docs