Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.37 KB

DOCKER.md

File metadata and controls

28 lines (19 loc) · 1.37 KB

Using docker and docker-compose for local development

docker-compose build
docker-compose run app python manage.py migrate
docker-compose up

A server will now be running at http://localhost:8000.

You will need to docker-compose build whenever requirements.txt changes since the dependencies are installed in the docker image (see Dockerfile).

Note that in docker-compose.yml, app is the name of the service for the Django application, and db is the name of the database service. You can run any command within those service containers using docker-compose run <SERVICE NAME> <COMMAND>.

For example:

  • docker-compose run app py.test will run the test suite.
  • docker-compose run db bash will get you a shell in the db container.

Use docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml <COMMAND> to execute commands in the mock-fsbid container from local code.

For example:

  • docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml build
  • docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml up
  • docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml run mock_fsbid npm run dev
  • docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml run mock_fsbid npm run migrate
  • docker-compose -f docker-compose.yml -f docker-compose.local-fsbid.yml run mock_fsbid npm run seed