Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 1.37 KB

DOCKER.md

File metadata and controls

73 lines (46 loc) · 1.37 KB

Docker support

Development

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

Attaching to the API container

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

Production

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

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

Migrations

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