chore: 后端服务端口统一为 8876:8876

This commit is contained in:
爽哒哒
2026-03-18 23:07:19 +08:00
parent 39137e07c5
commit 3ae9e6856d
2 changed files with 4 additions and 4 deletions

View File

@@ -30,11 +30,11 @@ COPY . .
RUN mkdir -p /app/media /app/static
# 暴露端口
EXPOSE 8000
EXPOSE 8876
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8000/api/health/')" || exit 1
CMD python -c "import requests; requests.get('http://localhost:8876/api/health/')" || exit 1
# 启动命令
CMD ["sh", "-c", "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8000 --workers 4 --threads 2 --worker-class gthread --access-logfile - --error-logfile - --capture-output --enable-stdio-inheritance config.wsgi:application"]
CMD ["sh", "-c", "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8876 --workers 4 --threads 2 --worker-class gthread --access-logfile - --error-logfile - --capture-output --enable-stdio-inheritance config.wsgi:application"]

View File

@@ -12,7 +12,7 @@ services:
- ./backend/media:/app/media
- ./backend/static:/app/static
ports:
- "8876:8000"
- "8876:8876"
environment:
- DEBUG=False
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this}