chore(deploy): expose flashcard on host port 4000 (4000:3000)
This commit is contained in:
10
DEPLOY.md
10
DEPLOY.md
@@ -8,8 +8,10 @@ Repo: `https://gitea.hausmans.cloud/bert.hausmans/flashcards`
|
|||||||
|
|
||||||
## What gets deployed
|
## What gets deployed
|
||||||
|
|
||||||
One container (`flashcard`) serving the API **and** the built frontend on port
|
One container (`flashcard`) serving the API **and** the built frontend. It listens
|
||||||
`3000`, with a persistent named volume (`flashcard-data`) for the SQLite database.
|
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.
|
Migrations run automatically on every container start.
|
||||||
|
|
||||||
## Step 1 — push the code to Gitea (from your dev machine)
|
## 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:
|
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).
|
(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
|
- `COOKIE_SECURE` → leave `"false"` for now (plain HTTP). Flip to `"true"` only
|
||||||
after you put the app behind HTTPS.
|
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
|
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
|
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)
|
## Step 5 — create the first account (becomes sysadmin)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ services:
|
|||||||
image: flashcard:local
|
image: flashcard:local
|
||||||
container_name: flashcard
|
container_name: flashcard
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
# host:container — exposed on 4000 on the Dockge host, app listens on 3000 inside.
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "4000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- flashcard-data:/data
|
- flashcard-data:/data
|
||||||
environment:
|
environment:
|
||||||
@@ -19,9 +20,9 @@ services:
|
|||||||
DB_PATH: /data/flashcard.db
|
DB_PATH: /data/flashcard.db
|
||||||
|
|
||||||
# URL where users reach the app. Used in verification / reset / invite emails.
|
# 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.
|
# 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
|
# Cookie security. Keep "false" when serving over plain HTTP — otherwise the
|
||||||
# browser drops the session cookie and login silently fails. Set to "true"
|
# browser drops the session cookie and login silently fails. Set to "true"
|
||||||
|
|||||||
Reference in New Issue
Block a user