From aa8c36d4b92ecc2b61099cd8ce56332e093772a9 Mon Sep 17 00:00:00 2001 From: Andrew Conlin Date: Sun, 13 Apr 2025 17:51:23 +0100 Subject: [PATCH] [2025-04-13] Docker setup --- build/Dockerfile | 12 ++++++++++++ gunicorn_config.py => build/gunicorn_config.py | 0 requirements.txt => build/requirements.txt | 0 {templates => build/templates}/index.html | 0 {templates => build/templates}/init.html | 0 year-progress.py => build/year-progress.py | 0 docker-compose.yml | 11 +++++++++++ 7 files changed, 23 insertions(+) create mode 100644 build/Dockerfile rename gunicorn_config.py => build/gunicorn_config.py (100%) rename requirements.txt => build/requirements.txt (100%) rename {templates => build/templates}/index.html (100%) rename {templates => build/templates}/init.html (100%) rename year-progress.py => build/year-progress.py (100%) create mode 100644 docker-compose.yml diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..a515c2a --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3-slim + +WORKDIR usr/src/app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 80 + +CMD ["gunicorn","--config", "gunicorn_config.py", "year-progress:app"] diff --git a/gunicorn_config.py b/build/gunicorn_config.py similarity index 100% rename from gunicorn_config.py rename to build/gunicorn_config.py diff --git a/requirements.txt b/build/requirements.txt similarity index 100% rename from requirements.txt rename to build/requirements.txt diff --git a/templates/index.html b/build/templates/index.html similarity index 100% rename from templates/index.html rename to build/templates/index.html diff --git a/templates/init.html b/build/templates/init.html similarity index 100% rename from templates/init.html rename to build/templates/init.html diff --git a/year-progress.py b/build/year-progress.py similarity index 100% rename from year-progress.py rename to build/year-progress.py diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7054e94 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + year-progress: + platform: "linux/arm64/v8" + image: year-progress:latest + container_name: year-progress + restart: unless-stopped + build: + context: build + dockerfile: Dockerfile + ports: + - "1111:80"