{"id":28739808,"url":"https://github.com/codingforentrepreneurs/django-auto-container","last_synced_at":"2025-06-16T06:10:56.567Z","repository":{"id":215702264,"uuid":"739568109","full_name":"codingforentrepreneurs/django-auto-container","owner":"codingforentrepreneurs","description":"Use this repo's GitHub workflow to automatically create a Django container and host on Docker Hub","archived":false,"fork":false,"pushed_at":"2024-01-08T18:36:27.000Z","size":21,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-10T01:58:38.836Z","etag":null,"topics":["containerization","containers","django","docker","docker-compose","hosting","kuberrnetes","nomad"],"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/codingforentrepreneurs.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-05T22:14:59.000Z","updated_at":"2024-12-26T22:37:36.000Z","dependencies_parsed_at":"2024-01-06T01:38:47.810Z","dependency_job_id":"354f1fd3-f610-4313-8dff-7dc3a33e2173","html_url":"https://github.com/codingforentrepreneurs/django-auto-container","commit_stats":null,"previous_names":["codingforentrepreneurs/django-auto-container"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codingforentrepreneurs/django-auto-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2Fdjango-auto-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2Fdjango-auto-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2Fdjango-auto-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2Fdjango-auto-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codingforentrepreneurs","download_url":"https://codeload.github.com/codingforentrepreneurs/django-auto-container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2Fdjango-auto-container/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260109606,"owners_count":22960037,"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":["containerization","containers","django","docker","docker-compose","hosting","kuberrnetes","nomad"],"created_at":"2025-06-16T06:10:55.906Z","updated_at":"2025-06-16T06:10:56.538Z","avatar_url":"https://github.com/codingforentrepreneurs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Django Auto Container\n\n\nThis repository contains a GitHub Actions workflow that automatically builds a Django-based container application and pushes it to Docker Hub using Buildpacks.\n\nThe purpose of this repo is to help Django devs use containers without having to learn Docker. \n\n## Getting Started\n\n### 1. Copy the Build Container Workflow this Repository\n\nNavigate to your Django project directory and copy the build container workflow from this repository.\n\n```bash\nmkdir -p .github/workflows\ncurl https://raw.githubusercontent.com/codingforentrepreneurs/django-auto-container/main/.github/workflows/build-container.yaml \u003e .github/workflows/build-container.yaml\n```\n\n### 2. Github Actions Secrets\nIn your GitHub Repo, add the following Secrets:\n#### Required Secrets:\nIf you do not include these secrets, the container will be built but not hosted anywhere.\n\n- `DOCKER_HUB_USERNAME`: Your Docker Hub username.\n- `DOCKER_HUB_TOKEN`: Your Docker Hub access token; create a new token [here](https://hub.docker.com/settings/security).\n\n\n#### Recommended Secrets:\n\nThese secrets are highly recommended to add for your specific project.\n- `DOCKER_HUB_REPO`: The Docker repository to push to, in the format `username/repository`. Defaults to the format of your GitHub repo if not set -- this is where you will store your container.\n- `BASE_DIR`: The default Django project location is `src/` as you see in this repo. If you have a different location, you can set it here.\n\n#### Optional Secrets:\nIf you need more advanced usage, consider adding these secrets to modify how your project works.\n- `BUILDPACK_BUILDER`: The buildpack builder to use. Defaults to 'heroku/buildpacks:22' if not set. Review various Heroku buildpacks [here](https://devcenter.heroku.com/articles/stack#stack-support-details)\n- `DOCKER_HUB_IMAGE_TAG`: The tag to use for the Docker image. Defaults to the commit SHA (recommended) or you can set this value yourself.\n\n### 3. Required Files\n\nIn my `BASE_DIR` (defaults to `src/`), I have the following files:\n- project.toml\n- requirements.txt\n\nThis files are needed to ensure the auto-container workflow runs correctly, review `src/` for working examples or use the following samples:\n\n`project.toml`\n```toml\n[[build.env]]\nname = \"DISABLE_COLLECTSTATIC\"\nvalue = \"1\"\n\n[[build.env]]\nname =  \"GOOGLE_RUNTIME_VERSION\"\nvalue = \"3.11.7\"\n\n[[build.env]]\nname = \"GOOGLE_ENTRYPOINT\"\nvalue = \"gunicorn cfehome.wsgi:application --bind \\\"0.0.0.0:$PORT\\\"\"\n```\nThe `GOOGLE_ENTRYPOINT` is the command that will be run when the container is started. In this case, it's the production version of running `python manage.py runserver` but with `gunicorn` instead of `runserver`.\n\n\n`requirements.txt`\n```\nDjango\ngunicorn\n```\n`gunicorn` is required as it's what is recommended to run Django in production.\n\n### 4. Push\n\nPush your code to GitHub and watch the magic happen. You can view the workflow in the \"Actions\" tab of your GitHub repo.\n\n### 5. Run\n\nIf you have Docker installed locally, you can run your application with:\n\n```\ndocker run -e PORT=8888 -p 8888:8888 \u003cyour-docker-hub-username\u003e/\u003cyour-docker-hub-repo\u003e:\u003cyour-docker-hub-image-tag\u003e\n```\nOpen [http://localhost:8888](http://localhost:8888) to view your application.\n\nIf you don't have Docker installed locally, you can run your application on any container host such as:\n\n- Kubernetes\n- Knative\n- Hashicorp Nomad\n- Any managed container hosting service","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingforentrepreneurs%2Fdjango-auto-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodingforentrepreneurs%2Fdjango-auto-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingforentrepreneurs%2Fdjango-auto-container/lists"}