Skip to content

🐢 Simple web server πŸ–₯ with Django, Gunicorn πŸ¦„, nginx and PostgreSQL 🐘

Notifications You must be signed in to change notification settings

denlove/django-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Django-docker project

Django + PostgresQL + nginx + Gunicorn + python

Note

There are production and development versions in this project. In dev, there is no nginx and Gunicorn. Just Django and PostgresQL.

Installation with Docker Compose

1. Give permissions to entrypoint files

// For dev
chmod +x app/entrypoint.sh

// For prod
chmod +x app/entrypoint.prod.sh

2. Add .env file (.env.dev or .env.prod) with .env.example

// For dev
nvim .env.dev

// For prod
nvim .env.prod

3. Build and up docker compose

// For dev
docker compose up -d --build

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

4. Run the migrations

// For prod
docker compose -f docker-compose.prod.yml exec web python manage.py migrate --noinput

5. Collect static files from each of your applications

// For prod
docker compose -f docker-compose.prod.yml exec web python manage.py collectstatic --no-input --clear

Tip

You can check logs in running containers like that:

docker compose -f docker-compose.prod.yml logs -f

About

🐢 Simple web server πŸ–₯ with Django, Gunicorn πŸ¦„, nginx and PostgreSQL 🐘

Resources

Stars

Watchers

Forks