Allow configurable host port
All checks were successful
Template Compliance / compliance (push) Successful in 30s
Release Dry Run / release-dry-run (push) Successful in 4m23s
Build / build (push) Successful in 5m25s

This commit is contained in:
MrSphay
2026-05-15 16:46:14 +02:00
parent eec1cbe4b6
commit 8f13745c26
4 changed files with 8 additions and 8 deletions

View File

@@ -4,4 +4,4 @@ NEXTAUTH_SECRET="change-me-with-openssl-rand-base64-32"
POSTGRES_DB="watchlink"
POSTGRES_USER="watchlink"
POSTGRES_PASSWORD="watchlink"
PORT="3000"
HOST_PORT="3000"

View File

@@ -50,7 +50,7 @@ POSTGRES_USER=watchlink
POSTGRES_PASSWORD=change-this-database-password
NEXTAUTH_URL=https://watchlink.example.com
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
PORT=3000
HOST_PORT=6852
```
For local testing, use:
@@ -61,7 +61,7 @@ POSTGRES_USER=watchlink
POSTGRES_PASSWORD=watchlink
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=change-me-with-openssl-rand-base64-32
PORT=3000
HOST_PORT=3000
```
Minimal `docker-compose.yml` using the published Gitea image:
@@ -93,7 +93,7 @@ services:
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
PORT: 3000
ports:
- "3000:3000"
- "${HOST_PORT:-3000}:3000"
command: sh -c "npx prisma migrate deploy && node server.js"
volumes:
@@ -106,7 +106,7 @@ Start the stack:
docker compose up --build
```
The Compose stack exposes the web app on `http://localhost:3000` and uses a Postgres volume named `watchlink_postgres-data`.
The Compose stack exposes the web app on `http://localhost:${HOST_PORT:-3000}` and uses a Postgres volume named `watchlink_postgres-data`. Keep the container `PORT` at `3000`; change `HOST_PORT` when another container already uses port 3000 on the host.
Build and publish the Gitea image:

View File

@@ -37,7 +37,7 @@ POSTGRES_USER=watchlink
POSTGRES_PASSWORD=change-this-database-password
NEXTAUTH_URL=https://watchlink.example.com
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
PORT=3000
HOST_PORT=6852
```
Minimal Compose using the published image:
@@ -69,7 +69,7 @@ services:
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
PORT: 3000
ports:
- "3000:3000"
- "${HOST_PORT:-3000}:3000"
command: sh -c "npx prisma migrate deploy && node server.js"
volumes:

View File

@@ -25,7 +25,7 @@ services:
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
PORT: 3000
ports:
- "3000:3000"
- "${HOST_PORT:-3000}:3000"
command: sh -c "npx prisma migrate deploy && node server.js"
volumes: