Allow configurable host port
This commit is contained in:
@@ -4,4 +4,4 @@ NEXTAUTH_SECRET="change-me-with-openssl-rand-base64-32"
|
|||||||
POSTGRES_DB="watchlink"
|
POSTGRES_DB="watchlink"
|
||||||
POSTGRES_USER="watchlink"
|
POSTGRES_USER="watchlink"
|
||||||
POSTGRES_PASSWORD="watchlink"
|
POSTGRES_PASSWORD="watchlink"
|
||||||
PORT="3000"
|
HOST_PORT="3000"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ POSTGRES_USER=watchlink
|
|||||||
POSTGRES_PASSWORD=change-this-database-password
|
POSTGRES_PASSWORD=change-this-database-password
|
||||||
NEXTAUTH_URL=https://watchlink.example.com
|
NEXTAUTH_URL=https://watchlink.example.com
|
||||||
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
|
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
|
||||||
PORT=3000
|
HOST_PORT=6852
|
||||||
```
|
```
|
||||||
|
|
||||||
For local testing, use:
|
For local testing, use:
|
||||||
@@ -61,7 +61,7 @@ POSTGRES_USER=watchlink
|
|||||||
POSTGRES_PASSWORD=watchlink
|
POSTGRES_PASSWORD=watchlink
|
||||||
NEXTAUTH_URL=http://localhost:3000
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
NEXTAUTH_SECRET=change-me-with-openssl-rand-base64-32
|
NEXTAUTH_SECRET=change-me-with-openssl-rand-base64-32
|
||||||
PORT=3000
|
HOST_PORT=3000
|
||||||
```
|
```
|
||||||
|
|
||||||
Minimal `docker-compose.yml` using the published Gitea image:
|
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}
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "${HOST_PORT:-3000}:3000"
|
||||||
command: sh -c "npx prisma migrate deploy && node server.js"
|
command: sh -c "npx prisma migrate deploy && node server.js"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
@@ -106,7 +106,7 @@ Start the stack:
|
|||||||
docker compose up --build
|
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:
|
Build and publish the Gitea image:
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ POSTGRES_USER=watchlink
|
|||||||
POSTGRES_PASSWORD=change-this-database-password
|
POSTGRES_PASSWORD=change-this-database-password
|
||||||
NEXTAUTH_URL=https://watchlink.example.com
|
NEXTAUTH_URL=https://watchlink.example.com
|
||||||
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
|
NEXTAUTH_SECRET=change-this-with-openssl-rand-base64-32
|
||||||
PORT=3000
|
HOST_PORT=6852
|
||||||
```
|
```
|
||||||
|
|
||||||
Minimal Compose using the published image:
|
Minimal Compose using the published image:
|
||||||
@@ -69,7 +69,7 @@ services:
|
|||||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "${HOST_PORT:-3000}:3000"
|
||||||
command: sh -c "npx prisma migrate deploy && node server.js"
|
command: sh -c "npx prisma migrate deploy && node server.js"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ services:
|
|||||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "${HOST_PORT:-3000}:3000"
|
||||||
command: sh -c "npx prisma migrate deploy && node server.js"
|
command: sh -c "npx prisma migrate deploy && node server.js"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user