updated docker-compose.yml

This commit is contained in:
2026-02-19 11:26:23 +09:00
parent 5c021511c4
commit 00194f3826
2 changed files with 7 additions and 30 deletions

View File

@@ -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,9 +6,12 @@ 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_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_ACCESS_SECRET=change-me-access-secret-at-least-32-chars
JWT_REFRESH_SECRET=change-me-refresh-secret-at-least-32-chars JWT_REFRESH_SECRET=change-me-refresh-secret-at-least-32-chars

View File

@@ -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:
@@ -69,7 +49,4 @@ services:
ports: ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}" - "${FRONTEND_PORT}:${FRONTEND_PORT}"
depends_on: depends_on:
- backend - backend
volumes:
postgres_data: