├── public
└── .keep
├── assets
├── js
│ └── app.js
├── .yarnrc
├── css
│ └── app.css
├── tailwind.config.js
├── static
│ ├── favicon.ico
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── images
│ │ └── django.png
│ ├── mstile-150x150.png
│ ├── apple-touch-icon.png
│ ├── android-chrome-192x192.png
│ ├── android-chrome-512x512.png
│ ├── robots.txt
│ ├── browserconfig.xml
│ ├── site.webmanifest
│ ├── maintenance.html
│ ├── 502.html
│ └── safari-pinned-tab.svg
├── package.json
├── esbuild.config.mjs
└── yarn.lock
├── src
├── __init__.py
├── up
│ ├── __init__.py
│ ├── apps.py
│ ├── urls.py
│ ├── views.py
│ └── tests.py
├── pages
│ ├── __init__.py
│ ├── apps.py
│ ├── urls.py
│ ├── tests.py
│ ├── views.py
│ └── templates
│ │ └── pages
│ │ └── home.html
├── config
│ ├── celery.py
│ ├── __init__.py
│ ├── asgi.py
│ ├── wsgi.py
│ ├── gunicorn.py
│ ├── urls.py
│ └── settings.py
├── manage.py
└── templates
│ └── layouts
│ └── index.html
├── public_collected
└── .keep
├── .hadolint.yaml
├── .github
├── FUNDING.yml
├── docs
│ └── screenshot.jpg
└── workflows
│ └── ci.yml
├── .editorconfig
├── bin
├── docker-entrypoint-web
├── uv-install
└── rename-project
├── .dockerignore
├── pyproject.toml
├── LICENSE
├── compose.yaml
├── Dockerfile
├── .gitignore
├── .env.example
├── run
├── CHANGELOG.md
├── README.md
└── uv.lock
/public/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/js/app.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/up/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public_collected/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/.yarnrc:
--------------------------------------------------------------------------------
1 | --modules-folder /node_modules
2 |
--------------------------------------------------------------------------------
/assets/css/app.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss" source("/app");
2 |
--------------------------------------------------------------------------------
/.hadolint.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | failure-threshold: "style"
3 | ignored:
4 | - "DL3008"
5 |
--------------------------------------------------------------------------------
/assets/tailwind.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: ["@tailwindcss/postcss"],
3 | };
4 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | github: "nickjj"
4 | custom: ["https://www.paypal.me/nickjanetakis"]
5 |
--------------------------------------------------------------------------------
/src/up/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class UpConfig(AppConfig):
5 | name = "up"
6 |
--------------------------------------------------------------------------------
/.github/docs/screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/.github/docs/screenshot.jpg
--------------------------------------------------------------------------------
/assets/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/favicon.ico
--------------------------------------------------------------------------------
/src/pages/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class PagesConfig(AppConfig):
5 | name = "pages"
6 |
--------------------------------------------------------------------------------
/assets/static/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/static/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/static/images/django.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/images/django.png
--------------------------------------------------------------------------------
/assets/static/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/mstile-150x150.png
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [[sh]]
2 | indent_style = space
3 | indent_size = 2
4 |
5 | [[bash]]
6 | indent_style = space
7 | indent_size = 2
8 |
--------------------------------------------------------------------------------
/assets/static/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/apple-touch-icon.png
--------------------------------------------------------------------------------
/assets/static/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/android-chrome-192x192.png
--------------------------------------------------------------------------------
/assets/static/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickjj/docker-django-example/HEAD/assets/static/android-chrome-512x512.png
--------------------------------------------------------------------------------
/src/pages/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 |
3 | from pages import views
4 |
5 | urlpatterns = [
6 | path("", views.home, name="home"),
7 | ]
8 |
--------------------------------------------------------------------------------
/src/up/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 |
3 | from up import views
4 |
5 | urlpatterns = [
6 | path("", views.index, name="index"),
7 | path("databases", views.databases, name="databases"),
8 | ]
9 |
--------------------------------------------------------------------------------
/assets/static/robots.txt:
--------------------------------------------------------------------------------
1 | # TODO: This will block all robots from crawling your site. You probably don't
2 | # want this set in production, but could be useful for a test / staging server.
3 | User-agent: *
4 | Disallow: /
5 |
--------------------------------------------------------------------------------
/bin/docker-entrypoint-web:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | # Always keep this here as it ensures your latest built assets make their way
6 | # into your volume persisted public directory.
7 | cp -r /public_collected /app
8 |
9 | exec "$@"
10 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .git/
2 | .ruff_cache
3 | .pytest_cache/
4 | __pycache__/
5 | assets/node_modules/
6 | public/
7 | public_collected/
8 |
9 | .coverage
10 | .dockerignore
11 | .env*
12 | !.env.example
13 | celerybeat-schedule
14 | docker-compose.override.yml
15 |
--------------------------------------------------------------------------------
/src/config/celery.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from celery import Celery
4 |
5 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
6 |
7 | app = Celery("hello")
8 | app.config_from_object("django.conf:settings", namespace="CELERY")
9 | app.autodiscover_tasks()
10 |
--------------------------------------------------------------------------------
/assets/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hello",
3 | "private": true,
4 | "dependencies": {
5 | "esbuild": "0.27.1",
6 | "esbuild-copy-static-files": "0.1.0",
7 | "tailwindcss": "4.1.17",
8 | "@tailwindcss/cli": "4.1.17",
9 | "@tailwindcss/postcss": "4.1.17"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/pages/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 |
4 | class ViewTests(TestCase):
5 | def test_home_page(self):
6 | """Home page should respond with a success 200."""
7 | response = self.client.get("/", follow=True)
8 | self.assertEqual(response.status_code, 200)
9 |
--------------------------------------------------------------------------------
/assets/static/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 | 13 | 🐳 Learn the Docker fundamentals at: 14 | 15 | https://diveintodocker.com 16 | 17 |
18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /assets/esbuild.config.mjs: -------------------------------------------------------------------------------- 1 | import * as esbuild from 'esbuild' 2 | import copyStaticFiles from 'esbuild-copy-static-files' 3 | 4 | let minify = false 5 | let sourcemap = true 6 | let watch = true 7 | 8 | if (process.env.NODE_ENV === 'production') { 9 | minify = true 10 | sourcemap = false 11 | watch = false 12 | } 13 | 14 | const config = { 15 | entryPoints: ['./js/app.js'], 16 | outfile: '../public/js/app.js', 17 | bundle: true, 18 | minify: minify, 19 | sourcemap: sourcemap, 20 | plugins: [copyStaticFiles()], 21 | } 22 | 23 | if (watch) { 24 | let context = await esbuild.context({...config, logLevel: 'info'}) 25 | await context.watch() 26 | } else { 27 | esbuild.build(config) 28 | } 29 | -------------------------------------------------------------------------------- /src/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | 4 | import os 5 | import sys 6 | 7 | 8 | def main(): 9 | """Run administrative tasks.""" 10 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") 11 | try: 12 | from django.core.management import execute_from_command_line 13 | except ImportError as exc: 14 | raise ImportError( 15 | "Couldn't import Django. Are you sure it's installed and " 16 | "available on your PYTHONPATH environment variable? Did you " 17 | "forget to activate a virtual environment?" 18 | ) from exc 19 | execute_from_command_line(sys.argv) 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: "CI" 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - "*" 7 | push: 8 | branches: 9 | - "main" 10 | - "master" 11 | schedule: 12 | - cron: "30 12 * * *" 13 | 14 | jobs: 15 | test: 16 | runs-on: "ubuntu-22.04" 17 | 18 | steps: 19 | - uses: "actions/checkout@v4" 20 | 21 | - name: "Install CI dependencies" 22 | run: | 23 | ./run ci:install-deps 24 | 25 | - name: "Test" 26 | run: | 27 | # Remove volumes in CI to avoid permission errors due to UID / GID. 28 | sed -i "s|.:/app|/tmp:/tmp|g" .env* 29 | sed -i "s|.:/app|/tmp:/tmp|g" compose.yaml 30 | 31 | # Django requires static files to be collected in order to run its 32 | # test suite. That means we need to generate production assets from 33 | # esbuild. This line ensures NODE_ENV is set to production. 34 | sed -i "s|export NODE_ENV|#export NODE_ENV|g" .env* 35 | 36 | ./run ci:test 37 | -------------------------------------------------------------------------------- /assets/static/maintenance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |If all goes well everything will be up and running by 2pm EST, please check back then.
30 |P.S., don't worry, your data is safely backed up!
31 |Status updates may be posted on Twitter at: @nickjanetakis
33 | 34 |