From 00194f3826eddfb2d0d5244667a148977a59adf6 Mon Sep 17 00:00:00 2001 From: binhkid2 Date: Thu, 19 Feb 2026 11:26:23 +0900 Subject: [PATCH] updated docker-compose.yml --- .env.for-docker-compose | 12 ++++++------ docker-compose.yml | 25 +------------------------ 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.env.for-docker-compose b/.env.for-docker-compose index a14c8f8..f4565b1 100644 --- a/.env.for-docker-compose +++ b/.env.for-docker-compose @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 430b465..6b8e7fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: \ No newline at end of file + - backend \ No newline at end of file