This is a magic repository for everyone who wants to start developing and do not want to worry about initial django and docker setup.
- Django
- Nginx
- PostgreSQL
- Docker Compose for development
- Docker Compose for production
- Caddy config for fast SSL + domain deploy
- Poetry dependency manager
- Initial entrypoint to take care of django and postgres setup
Just docker compose up
and you will see your development version at 127.0.0.1:1111
Restart your django container (using Docker GUI) everytime you make a change in app logic.
Django's templates engine is reloading without container needed to restart
Docker context is a bridge to your remote server to run docker commands on your local pc or mac.
docker context create new_ip --docker "host=ssh://username@ip"
docker build -t username/project:latest .
(don't forget dot at the end)
docker push username/project:latest
docker context use new_ip
docker compose -f docker-compose-prod.yaml down
Here consider deleting static volume if you have static files modified
docker pull username/project:latest
docker compose -f docker-compose-prod.yaml up -d --force-recreate
docker context use default
Install Caddy Server, replace example.com
with your domain in Caddyfile
and run command:
sudo caddy stop
sudo caddy run
Consider adding caddy
to linux start up sequence.