Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 1.53 KB

README.md

File metadata and controls

72 lines (46 loc) · 1.53 KB

Vadee backend using Django with Postgres, Gunicorn, and Nginx

Development

Get the dapp submodule:

git submodule init

Uses the default Django development server.

  1. Rename .env.dev-sample to .env.

  2. Update the environment variables in the and .env.dev files.

  3. Build the images and run the containers:

    docker-compose up -d --build

    Test it out at http://localhost:8000. The "app" folder is mounted into the container and your code changes apply automatically.

Note: You need up and running containers to run next commands otherwise you will get ERROR: No container found for web_1!

  1. You need to make migrations?

    ./scripts/makemigrations.sh
  2. You need to apply migrations?

    ./scripts/migrate.sh
  3. You need a shell inside container?

    ./scripts/shell.sh
  4. You wand direct db shell?

    ./scripts/psql.sh
  5. Anything else?

    docker-compose exec <SERVICE> <COMMAND>

Production

Uses gunicorn + nginx.

Follow https://dockerswarm.rocks/ till the end of Portainer section.

  1. Rename .env.prod-sample to .env. Update the environment variables.

  2. Build the images and run the containers:

    docker-compose -f docker-compose.prod.yml up -d --build

Test it out at http://localhost:1818. No mounted folders. To apply changes, the image must be re-built.


Docker files inspired from https://github.com/testdrivenio/django-on-docker/