From fe44e393b349cddf459f9077ff56655aea7d91f7 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Thu, 21 May 2026 09:58:59 +0200 Subject: [PATCH] chore(deploy): expose flashcard on host port 4000 (4000:3000) --- DEPLOY.md | 10 ++++++---- compose.yaml | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/DEPLOY.md b/DEPLOY.md index 0e99c09..bb85237 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -8,8 +8,10 @@ Repo: `https://gitea.hausmans.cloud/bert.hausmans/flashcards` ## What gets deployed -One container (`flashcard`) serving the API **and** the built frontend on port -`3000`, with a persistent named volume (`flashcard-data`) for the SQLite database. +One container (`flashcard`) serving the API **and** the built frontend. It listens +on port `3000` inside the container, mapped to **`4000` on the Dockge host** +(`4000:3000` in `compose.yaml`). A persistent named volume (`flashcard-data`) holds +the SQLite database. Migrations run automatically on every container start. ## Step 1 — push the code to Gitea (from your dev machine) @@ -35,7 +37,7 @@ A "flashcard" stack now appears in the Dockge UI (it reads `compose.yaml`). Open the **flashcard** stack in Dockge and edit the `environment:` block: -- `APP_URL` → how you reach the app, e.g. `http://:3000` +- `APP_URL` → how you reach the app, e.g. `http://:4000` (this is what verification/reset/invite e-mail links use — get it right). - `COOKIE_SECURE` → leave `"false"` for now (plain HTTP). Flip to `"true"` only after you put the app behind HTTPS. @@ -46,7 +48,7 @@ Open the **flashcard** stack in Dockge and edit the `environment:` block: Click **Deploy** (Dockge runs `docker compose up -d --build`). First build takes a few minutes (installs deps, builds the frontend, compiles better-sqlite3). When it's -up, open `http://:3000`. +up, open `http://:4000`. ## Step 5 — create the first account (becomes sysadmin) diff --git a/compose.yaml b/compose.yaml index dc3f332..b75afec 100644 --- a/compose.yaml +++ b/compose.yaml @@ -9,8 +9,9 @@ services: image: flashcard:local container_name: flashcard restart: unless-stopped + # host:container — exposed on 4000 on the Dockge host, app listens on 3000 inside. ports: - - "3000:3000" + - "4000:3000" volumes: - flashcard-data:/data environment: @@ -19,9 +20,9 @@ services: DB_PATH: /data/flashcard.db # URL where users reach the app. Used in verification / reset / invite emails. - # CHANGE THIS to your real address, e.g. http://192.168.1.50:3000 + # CHANGE THIS to your real address, e.g. http://192.168.1.50:4000 # or https://flashcards.hausmans.cloud once behind a reverse proxy. - APP_URL: "http://CHANGE-ME:3000" + APP_URL: "http://CHANGE-ME:4000" # Cookie security. Keep "false" when serving over plain HTTP — otherwise the # browser drops the session cookie and login silently fails. Set to "true"