{"id":20196556,"url":"https://github.com/endalk200/prod-django-docker-config","last_synced_at":"2026-05-04T18:33:35.413Z","repository":{"id":45121582,"uuid":"415537073","full_name":"endalk200/prod-django-docker-config","owner":"endalk200","description":"This repository contains Django application docker configuration for production environment ","archived":false,"fork":false,"pushed_at":"2022-01-06T22:56:34.000Z","size":24,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T04:29:12.541Z","etag":null,"topics":["digitalocean","digitalocean-container-registry","django","docker","production-docker-config"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/endalk200.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-10T09:13:04.000Z","updated_at":"2023-08-29T10:11:19.000Z","dependencies_parsed_at":"2022-09-02T22:32:08.769Z","dependency_job_id":null,"html_url":"https://github.com/endalk200/prod-django-docker-config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/endalk200/prod-django-docker-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fprod-django-docker-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fprod-django-docker-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fprod-django-docker-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fprod-django-docker-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endalk200","download_url":"https://codeload.github.com/endalk200/prod-django-docker-config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fprod-django-docker-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32619700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["digitalocean","digitalocean-container-registry","django","docker","production-docker-config"],"created_at":"2024-11-14T04:24:41.781Z","updated_at":"2026-05-04T18:33:35.389Z","avatar_url":"https://github.com/endalk200.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Production Django Docker Config\n\nFor detailed explanation read the full blog.\n\n- [Production-Ready Docker Configuration With DigitalOcean Container Registry Part I](https://endalk200.medium.com/production-ready-docker-configuration-with-digitalocean-container-registry-part-i-e53ea56b4be1)\n- [Production-Ready Docker Configuration With DigitalOcean Container Registry Part II](https://endalk200.medium.com/production-ready-docker-configuration-with-digitalocean-container-registry-part-ii-5361b8e6d5e0)\n\n[subscribe](https://medium.com/subscribe/@endalk200) for more articles like this.\n\nThis project is to document production-ready Docker setup. Please note that Django application is rudimentary and not fit for production.\n\nThis project present docker setup of four component of a typical Django application i.e. \n\n- web server\n- `celery worker`\n- `celery beat` and \n- `celery monitoring` using `flower`.\n\n## Docker Setup\n\nDetailed documentation of Docker setup can be found in above blog.\nIt discusses in detail `Dockerfile`, for both the web server and postgresql `entrypoint.sh`, `start.sh`, `backup.sh` and `restore.sh`\n\n### Useful Commands\n\nTo be run from root of the project. Before you run your docker containers rename the `.env_copy` file to `.env`. The docker compose file loads environment variables from that file.\n\n1. To start all containers including essential services(PostgreSQL and Redis):  `docker-compose up`\n\n2. Stop all containers: `docker-compose down`\n\n3. To backup all the data in the database to the container itself `docker-compose exec postgres backup` **NOTE:** The backup is not stored locally.\n\n4. To list all existing backups `docker-compose exec postgres backups`\n\n5. To copy the backup file from the container to your local machine, First run `docker ps` and grab the container ID of your postgresql container then run `docker cp 9c5c3f055843:/backups ./backups` this will copy all your database backups to your `/backups` directory locally.\n\n6. If you want to automate the backup process you can grab the container ID of your postgresql db and backup as follows `docker cp $(docker-compose ps -q postgres):/backups ./backups`\n\n7. To restore your backup `docker-compose exec postgres restore backup_2021_03_13T09_05_07.sql.gz`. Assuming your backup filename is `backup_2021_03_13T09_05_07.sql.gz`\n\n## Django application details\n\nThe Django application has a simple view `dockerapp/core/views.py` linked to url `/task-trigger/`, which picks a random integer between 1 and 100 and send to celery task(defined in `dockerapp/core/tasks.py`) which count next five integer at interval of one second.\n\n## Development\n\nThis is a work in progress, hence further enhancements in all aspects of Docker in this project is expected. Any advice regarding improvement of Docker aspect is welcome and encouraged.\n\nFor detailed discussion please refer to corresponding blog \n\n**Use the following link to get 100 USD in DigitalOcean free credit**\n\n[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=7a5167a14566\u0026utm_campaign=Referral_Invite\u0026utm_medium=Referral_Program\u0026utm_source=badge)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendalk200%2Fprod-django-docker-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendalk200%2Fprod-django-docker-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendalk200%2Fprod-django-docker-config/lists"}