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)
|
# Backend (NestJS)
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
@@ -9,8 +6,11 @@ HOST=0.0.0.0
|
|||||||
BACKEND_PORT=3001
|
BACKEND_PORT=3001
|
||||||
APP_URL=http://localhost:3001
|
APP_URL=http://localhost:3001
|
||||||
|
|
||||||
DB_HOST=postgres
|
DB_HOST=your-remote-db-host.example.com
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
|
DB_USER=your_db_user
|
||||||
|
DB_PASSWORD=your_db_password
|
||||||
|
DB_NAME=your_db_name
|
||||||
DB_SSL=false
|
DB_SSL=false
|
||||||
|
|
||||||
JWT_ACCESS_SECRET=change-me-access-secret-at-least-32-chars
|
JWT_ACCESS_SECRET=change-me-access-secret-at-least-32-chars
|
||||||
|
|||||||
@@ -1,23 +1,6 @@
|
|||||||
version: '3.9'
|
version: '3.9'
|
||||||
|
|
||||||
services:
|
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:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
@@ -53,9 +36,6 @@ services:
|
|||||||
FRONTEND_URL: ${FRONTEND_URL}
|
FRONTEND_URL: ${FRONTEND_URL}
|
||||||
ports:
|
ports:
|
||||||
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
||||||
depends_on:
|
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
@@ -70,6 +50,3 @@ services:
|
|||||||
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
|
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
Reference in New Issue
Block a user