{"id":15792945,"url":"https://github.com/sreevardhanreddi/django_docker_template","last_synced_at":"2025-10-28T02:43:34.383Z","repository":{"id":43230301,"uuid":"282802428","full_name":"sreevardhanreddi/django_docker_template","owner":"sreevardhanreddi","description":"A docker config for Development and Production","archived":false,"fork":false,"pushed_at":"2022-11-22T06:34:48.000Z","size":170,"stargazers_count":3,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T19:47:14.630Z","etag":null,"topics":["celery","celerybeat","containers","django","docker","nginx","postgresql","redis","template"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sreevardhanreddi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-27T05:28:58.000Z","updated_at":"2023-09-26T03:31:57.000Z","dependencies_parsed_at":"2023-01-23T03:15:41.227Z","dependency_job_id":null,"html_url":"https://github.com/sreevardhanreddi/django_docker_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/sreevardhanreddi/django_docker_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sreevardhanreddi%2Fdjango_docker_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sreevardhanreddi%2Fdjango_docker_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sreevardhanreddi%2Fdjango_docker_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sreevardhanreddi%2Fdjango_docker_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sreevardhanreddi","download_url":"https://codeload.github.com/sreevardhanreddi/django_docker_template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sreevardhanreddi%2Fdjango_docker_template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266120525,"owners_count":23879336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","celerybeat","containers","django","docker","nginx","postgresql","redis","template"],"created_at":"2024-10-04T23:07:20.796Z","updated_at":"2025-10-28T02:43:29.348Z","avatar_url":"https://github.com/sreevardhanreddi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-docker-template\n\n## docker setup for local development\n\n- supports sqlite3 and postgres for db (db can be a docker service)\n- supports static and media files serving\n\n## docker setup for production\n\n- nginx for proxying requests to application server, and serving static and media files\n- application server (a.k.a django project) is run by **gunicorn**\n- application server is connected to a separate db service\n\n```yml\nversion: \"3.7\"\n\nservices:\n  nginx:\n    build: ./nginx-proxy\n    volumes:\n      - static_volume:/app/staticfiles\n      - media_volume:/app/media\n    ports:\n      - 81:80\n    depends_on:\n      - web\n    restart: on-failure:5\n  web:\n    build:\n      context: ./web-project\n      dockerfile: Dockerfile.prod\n    volumes:\n      - static_volume:/app/staticfiles\n      - media_volume:/app/media\n    expose:\n      - 8000\n    env_file:\n      - .env.prod\n    depends_on:\n      - db\n  db:\n    build:\n      context: ./postgres-db\n    volumes:\n      - postgres_data:/var/lib/postgresql/data\n    env_file:\n      - .env.prod\n\n  worker:\n    build:\n      context: ./web-project\n      dockerfile: Dockerfile.worker\n    command: celery worker --app=django_project --loglevel=info --logfile=celery.log\n    env_file:\n      - .env.prod\n    depends_on:\n      - web\n      - redis\n\n  worker-celery-beat:\n    build:\n      context: ./web-project\n      dockerfile: Dockerfile.worker\n    command: celery worker --app=django_project -B --loglevel=info --logfile=celery.log\n    env_file:\n      - .env.prod\n    depends_on:\n      - web\n      - redis\n\n  redis:\n    build: ./redis\n\nvolumes:\n  postgres_data:\n  static_volume:\n  media_volume:\n```\n\n## Commands\n\n```shell\n\n# for development localhost:8000\ndocker-compose up --build -d\n\n# for production localhost:81\ndocker-compose -f docker-compose-prod.yml up --build -d\n\n\n```\n\n## Architecture\n\n\u003cimg alt=\"architecture\" src=\"./app.svg\"\u003e\n\n## TODO\n\n- [ ] figure out how to add SSL for nginx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsreevardhanreddi%2Fdjango_docker_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsreevardhanreddi%2Fdjango_docker_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsreevardhanreddi%2Fdjango_docker_template/lists"}