Document compose deployment config
This commit is contained in:
60
README.md
60
README.md
@@ -42,6 +42,66 @@ npm run audit
|
||||
|
||||
## Docker
|
||||
|
||||
Create a production `.env` file before starting Compose:
|
||||
|
||||
```env
|
||||
POSTGRES_DB=watchlink
|
||||
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
|
||||
```
|
||||
|
||||
For local testing, use:
|
||||
|
||||
```env
|
||||
POSTGRES_DB=watchlink
|
||||
POSTGRES_USER=watchlink
|
||||
POSTGRES_PASSWORD=watchlink
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
NEXTAUTH_SECRET=change-me-with-openssl-rand-base64-32
|
||||
PORT=3000
|
||||
```
|
||||
|
||||
Minimal `docker-compose.yml` using the published Gitea image:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-watchlink}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-watchlink}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-watchlink}
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-watchlink} -d ${POSTGRES_DB:-watchlink}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
web:
|
||||
image: git.wilkensxl.de/mrsphay/watchlink:latest
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-watchlink}:${POSTGRES_PASSWORD:-watchlink}@postgres:5432/${POSTGRES_DB:-watchlink}?schema=public
|
||||
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
|
||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
||||
PORT: 3000
|
||||
ports:
|
||||
- "3000:3000"
|
||||
command: sh -c "npx prisma migrate deploy && node server.js"
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
```
|
||||
|
||||
Start the stack:
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
47
blueprint.md
47
blueprint.md
@@ -29,6 +29,53 @@ npm run dev
|
||||
|
||||
## Docker
|
||||
|
||||
Production `.env`:
|
||||
|
||||
```env
|
||||
POSTGRES_DB=watchlink
|
||||
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
|
||||
```
|
||||
|
||||
Minimal Compose using the published image:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-watchlink}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-watchlink}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-watchlink}
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-watchlink} -d ${POSTGRES_DB:-watchlink}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
web:
|
||||
image: git.wilkensxl.de/mrsphay/watchlink:latest
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-watchlink}:${POSTGRES_PASSWORD:-watchlink}@postgres:5432/${POSTGRES_DB:-watchlink}?schema=public
|
||||
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
|
||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-change-me-with-openssl-rand-base64-32}
|
||||
PORT: 3000
|
||||
ports:
|
||||
- "3000:3000"
|
||||
command: sh -c "npx prisma migrate deploy && node server.js"
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
```
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user