添加docker

This commit is contained in:
2026-01-22 15:04:59 +00:00
parent 25dffcc02e
commit 59af236500
5 changed files with 265 additions and 0 deletions

43
docker-compose.yml Normal file
View File

@@ -0,0 +1,43 @@
version: '3.8'
services:
# Production service
prisma:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: prisma-app
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- GEMINI_API_KEY=${GEMINI_API_KEY}
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
# Development service
prisma-dev:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: prisma-dev
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- GEMINI_API_KEY=${GEMINI_API_KEY}
volumes:
# Mount source code for hot reloading
- ./prisma:/app:delegated
# Use anonymous volumes for node_modules to prevent overwriting
- /app/node_modules
restart: unless-stopped
stdin_open: true
tty: true