chore: 添加 Docker 打包和 Compose 编排支持

This commit is contained in:
2026-04-02 02:43:21 +08:00
parent 9175909033
commit ed770909ef
4 changed files with 74 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
services:
app:
build: .
ports:
- '3000:3000'
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
depends_on:
db:
condition: service_healthy
db:
image: postgres:17-alpine
# ports:
# - '5432:5432'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
interval: 5s
timeout: 5s
retries: 5
volumes:
pgdata: