58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
# 本地开发和手动构建场景
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
platform: linux/amd64
|
|
container_name: stock-scanner-app
|
|
ports:
|
|
- "8888:8888"
|
|
environment:
|
|
- API_KEY=${API_KEY}
|
|
- API_URL=${API_URL}
|
|
- API_MODEL=${API_MODEL}
|
|
- API_TIMEOUT=${API_TIMEOUT}
|
|
- LOGIN_PASSWORD=${LOGIN_PASSWORD}
|
|
- ANNOUNCEMENT_TEXT=${ANNOUNCEMENT_TEXT}
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8888/api/config"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 5s
|
|
networks:
|
|
- stock-scanner-network
|
|
|
|
nginx:
|
|
image: nginx:stable-alpine
|
|
container_name: stock-scanner-nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- ./nginx/logs:/var/log/nginx
|
|
- ./nginx/ssl:/etc/nginx/ssl
|
|
depends_on:
|
|
- app
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:80"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 5s
|
|
networks:
|
|
- stock-scanner-network
|
|
|
|
networks:
|
|
stock-scanner-network:
|
|
driver: bridge
|