add: custom postgress data path for coolify docker compose
This commit is contained in:
@@ -27,7 +27,12 @@ Choose one:
|
||||
- Build Pack: Docker Compose
|
||||
- File: `./docker-compose.coolify.yml`
|
||||
4. Assign domain to `app` service only (format: `http://yourdomain.com:3000`)
|
||||
5. Set environment variables (if needed)
|
||||
5. Set environment variables:
|
||||
- `AUTH_SECRET` (generate with `openssl rand -base64 32`)
|
||||
- `AUTH_URL` (your domain with https)
|
||||
- `POSTGRES_DATA_PATH` (optional, for custom database storage location)
|
||||
- `GOOGLE_CLIENT_ID` (optional)
|
||||
- `GOOGLE_CLIENT_SECRET` (optional)
|
||||
6. Deploy
|
||||
|
||||
### Using Dockerfile
|
||||
@@ -65,6 +70,10 @@ Required:
|
||||
Optional:
|
||||
- `GOOGLE_CLIENT_ID`
|
||||
- `GOOGLE_CLIENT_SECRET`
|
||||
- `POSTGRES_DATA_PATH` - Custom path for PostgreSQL data (Docker Compose only)
|
||||
- Example: `/mnt/storage/wishlist/postgres`
|
||||
- If not set, uses a Docker named volume
|
||||
- Path must exist with proper permissions before deployment
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
@@ -39,6 +39,15 @@ Required:
|
||||
- `NODE_ENV` - Set to `production`
|
||||
- `PORT` - Default `3000`
|
||||
|
||||
Optional (Docker Compose):
|
||||
- `POSTGRES_USER` - Database user (default: `wishlistuser`)
|
||||
- `POSTGRES_PASSWORD` - Database password (default: `wishlistpassword`)
|
||||
- `POSTGRES_DB` - Database name (default: `wishlist`)
|
||||
- `POSTGRES_DATA_PATH` - Custom path for PostgreSQL data
|
||||
- Example: `/mnt/storage/wishlist/postgres`
|
||||
- Must be an absolute path
|
||||
- Directory must exist with proper permissions
|
||||
|
||||
## Database Setup
|
||||
|
||||
```bash
|
||||
|
||||
@@ -9,7 +9,9 @@ services:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wishlistpassword}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-wishlist}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- type: bind
|
||||
source: ${POSTGRES_DATA_PATH}
|
||||
target: /var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-wishlistuser} -d ${POSTGRES_DB:-wishlist}"]
|
||||
interval: 10s
|
||||
@@ -47,6 +49,3 @@ services:
|
||||
- traefik.http.middlewares.wishlist-headers.headers.customrequestheaders.X-Forwarded-Proto=https
|
||||
- traefik.http.middlewares.wishlist-headers.headers.customrequestheaders.X-Forwarded-Host=wish.rasmusq.com
|
||||
- traefik.http.routers.wishlist.middlewares=wishlist-headers
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user