Allow configurable host port
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user