feat: 添加Nginx反代支持

This commit is contained in:
CaasianVale
2025-03-09 17:10:11 +08:00
parent 9ae1e60f7a
commit 3421e32ac1
5 changed files with 246 additions and 23 deletions

View File

@@ -39,6 +39,41 @@ services:
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: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 128M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- stock-scanner-network
networks:
stock-scanner-network:
driver: bridge