A starter setup for Django running on docker.
- Create a
.env.dev
file based off.env.dev.example
mv .env.dev.example .env.dev
-
Modify the
.env.dev
file to your needs. -
Build the Docker Compose setup:
docker-compose build
- Bring up the services:
docker-compose up -d
- Run the migrations for django:
docker-compose exec web python manage.py migrate --noinput
More coming soon but for now the following will spin up nginx reverse proxy with django using wsgi with staticfiles in nginx as well.
docker-compose -f docker-compose.prod.yml up -d --build
docker-compose -f docker-compose.prod.yml exec web python manage.py migrate --noinput
docker-compose -f docker-compose.prod.yml exec web python manage.py collectstatic --no-input --clear
Below are some commands you can run via the docker compose setup against the containers.
You can get a shell to postgres via:
docker-compose exec db psql --username=starter_django --dbname=starter_django_dev