updated docker-compose.yml
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
# Postgres
|
||||
DB_USER=postgres
|
||||
DB_PASSWORD=password
|
||||
DB_NAME=nestjs_blog
|
||||
|
||||
|
||||
# Backend (NestJS)
|
||||
NODE_ENV=production
|
||||
@@ -9,9 +6,12 @@ HOST=0.0.0.0
|
||||
BACKEND_PORT=3001
|
||||
APP_URL=http://localhost:3001
|
||||
|
||||
DB_HOST=postgres
|
||||
DB_HOST=your-remote-db-host.example.com
|
||||
DB_PORT=5432
|
||||
DB_SSL=false
|
||||
DB_USER=your_db_user
|
||||
DB_PASSWORD=your_db_password
|
||||
DB_NAME=your_db_name
|
||||
DB_SSL=false
|
||||
|
||||
JWT_ACCESS_SECRET=change-me-access-secret-at-least-32-chars
|
||||
JWT_REFRESH_SECRET=change-me-refresh-secret-at-least-32-chars
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
@@ -53,9 +36,6 @@ services:
|
||||
FRONTEND_URL: ${FRONTEND_URL}
|
||||
ports:
|
||||
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
build:
|
||||
@@ -69,7 +49,4 @@ services:
|
||||
ports:
|
||||
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
- backend
|
||||
Reference in New Issue
Block a user