From 9313b54abb0a1a486abe754ffe2e3023b7a3e8b5 Mon Sep 17 00:00:00 2001 From: Alfredo Di Stasio Date: Mon, 27 Apr 2026 09:48:55 +0200 Subject: [PATCH] Move compose settings to env file --- README.md | 8 +++++++- compose.yaml | 11 ++++------- env | 3 +++ 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 env diff --git a/README.md b/README.md index 5cd2aa1..17006cc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ source .venv/bin/activate pip install -e ".[dev]" ``` -### Run +### Run Container ```bash export FLASK_APP=wsgi.py @@ -86,6 +86,12 @@ Open `http://127.0.0.1:8000`. docker compose up --build web ``` +Compose settings are stored in `env`. Update that file to change values such as: + +- `SECRET_KEY` +- `MAX_UPLOAD_SIZE_MB` +- `OUTPUT_DIRECTORY` + ### Run the test suite in a container ```bash diff --git a/compose.yaml b/compose.yaml index 9aaa058..b78095e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,15 +5,12 @@ services: target: production ports: - "8000:8000" - environment: - SECRET_KEY: change-me - MAX_UPLOAD_SIZE_MB: "120" - OUTPUT_DIRECTORY: /app/instance/outputs + env_file: + - env test: build: context: . target: test - environment: - MAX_UPLOAD_SIZE_MB: "120" - OUTPUT_DIRECTORY: /app/instance/outputs + env_file: + - env diff --git a/env b/env new file mode 100644 index 0000000..ddf01ce --- /dev/null +++ b/env @@ -0,0 +1,3 @@ +SECRET_KEY=change-me +MAX_UPLOAD_SIZE_MB=120 +OUTPUT_DIRECTORY=/app/instance/outputs