diff --git a/backend/Dockerfile b/backend/Dockerfile index 342d7ff..20e1d69 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 629d8f6..3da7098 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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}