Commit 1491b098 authored by root's avatar root
Browse files

docker 3

parent 8f99361a
version: '3.8'
services:
# Next.js 应用服务
app:
build: .
container_name: chatroom-app
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/chatroom?schema=public
depends_on:
db:
condition: service_healthy
restart: unless-stopped
# PostgreSQL 数据库服务
db:
image: postgres:15
container_name: chatroom-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chatroom
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres-data:
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment