创建新工程
This commit is contained in:
64
docker-compose.prod.yml
Normal file
64
docker-compose.prod.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
ai-town-server:
|
||||
build:
|
||||
context: ./server
|
||||
dockerfile: Dockerfile.prod
|
||||
container_name: ai-town-server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8081:8081"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=8080
|
||||
- ADMIN_PORT=8081
|
||||
- ADMIN_TOKEN=${ADMIN_TOKEN:-admin123}
|
||||
volumes:
|
||||
- ./server/data:/app/data
|
||||
- ./logs:/app/logs
|
||||
networks:
|
||||
- ai-town-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: ai-town-nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./web:/usr/share/nginx/html
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./nginx/ssl:/etc/nginx/ssl
|
||||
depends_on:
|
||||
- ai-town-server
|
||||
networks:
|
||||
- ai-town-network
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: ai-town-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- ai-town-network
|
||||
command: redis-server --appendonly yes
|
||||
|
||||
networks:
|
||||
ai-town-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user