chore(deploy): expose flashcard on host port 4000 (4000:3000)

This commit is contained in:
2026-05-21 09:58:59 +02:00
parent 34b6c8d945
commit fe44e393b3
2 changed files with 10 additions and 7 deletions

View File

@@ -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://<dockge-host-ip>:3000`
- `APP_URL` → how you reach the app, e.g. `http://<dockge-host-ip>: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://<dockge-host-ip>:3000`.
up, open `http://<dockge-host-ip>:4000`.
## Step 5 — create the first account (becomes sysadmin)

View File

@@ -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"