chore: 后端服务端口统一为 8876:8876
All checks were successful
Deploy to Server / deploy (push) Successful in 18s
All checks were successful
Deploy to Server / deploy (push) Successful in 18s
This commit is contained in:
@@ -30,11 +30,11 @@ COPY . .
|
|||||||
RUN mkdir -p /app/media /app/static
|
RUN mkdir -p /app/media /app/static
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 8000
|
EXPOSE 8876
|
||||||
|
|
||||||
# 健康检查
|
# 健康检查
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
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"]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ services:
|
|||||||
- ./backend/media:/app/media
|
- ./backend/media:/app/media
|
||||||
- ./backend/static:/app/static
|
- ./backend/static:/app/static
|
||||||
ports:
|
ports:
|
||||||
- "8876:8000"
|
- "8876:8876"
|
||||||
environment:
|
environment:
|
||||||
- DEBUG=False
|
- DEBUG=False
|
||||||
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this}
|
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this}
|
||||||
|
|||||||
Reference in New Issue
Block a user