From e6fbe84d58b8171c3e0490b0dfcb8e9bdc92668d Mon Sep 17 00:00:00 2001 From: elpatron Date: Thu, 2 Apr 2026 18:44:07 +0200 Subject: [PATCH] Add Docker-Compose setup with configurable local port via .env. Document container startup and local port configuration in README, including a .env example for quick setup. Made-with: Cursor --- .env.example | 1 + README.md | 32 ++++++++++++++++++++++++++++++++ docker-compose.yml | 8 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 .env.example create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..850a15d --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +LOCAL_PORT=5000 diff --git a/README.md b/README.md index 9253d52..d3d62a1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,38 @@ pip install -r requirements.txt python app.py ``` +## Docker Compose + +Run the app with Docker Compose and configure the local host port via `.env`. + +1. Create a `.env` file in the project root (or copy `.env.example`): + +```bash +# macOS / Linux +cp .env.example .env + +# Windows (PowerShell) +Copy-Item .env.example .env +``` + +2. Set the local host port in `.env`: + +```dotenv +LOCAL_PORT=5000 +``` + +3. Build and start the container: + +```bash +docker compose up --build -d +``` + +4. Open the app in your browser: + +```text +http://localhost: +``` + Visit [https://date.elpatron.me](https://date.elpatron.me) for the live demo. ## License diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a54f005 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + datecalc: + build: + context: . + dockerfile: Dockerfile + ports: + - "${LOCAL_PORT:-5000}:5000" + restart: unless-stopped