From d125efebb07d89e65cf5bf50381c8c0ea28e07ef Mon Sep 17 00:00:00 2001 From: jwradhe Date: Tue, 16 Dec 2025 20:33:01 +0100 Subject: [PATCH] =?UTF-8?q?L=C3=A4gg=20till=20st=C3=B6d=20f=C3=B6r=20docke?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 7 +++++++ Dockerfile | 14 ++++++++++++++ app.py | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..336f970 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +.pytest_cache/ +venv/ +.git/ +.DS_Store +todo.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..482b7da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.12-slim + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY requirements.txt /app/requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +COPY . /app +EXPOSE 5001 + +CMD ["python", "app.py"] diff --git a/app.py b/app.py index 77c59f9..3efe784 100644 --- a/app.py +++ b/app.py @@ -160,4 +160,5 @@ def create_app(test_config: dict | None = None) -> Flask: if __name__ == "__main__": app = create_app() - app.run(host="127.0.0.1", port=5001, debug=True) + debug = os.environ.get("FLASK_DEBUG", "0") == "1" + app.run(host="0.0.0.0", port=5001, debug=debug)