ソースを参照

-dev:测试docker

LuoChinWen 4 週間 前
コミット
e6b2a3ad89
2 ファイル変更5 行追加5 行削除
  1. 3 3
      backend/Dockerfile
  2. 2 2
      backend/docker-compose.yml

+ 3 - 3
backend/Dockerfile

@@ -23,9 +23,9 @@ COPY . .
 
 RUN mkdir -p /app/data
 
-EXPOSE 8003
+EXPOSE 8000
 
 HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
-    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')" || exit 1
+    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
 
-CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8003"]
+CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

+ 2 - 2
backend/docker-compose.yml

@@ -8,7 +8,7 @@ services:
       dockerfile: Dockerfile
     container_name: lq-label-backend
     ports:
-      - "8003:8003"
+      - "8003:8000"
     volumes:
       # 持久化数据库文件
       - ./data:/app/data
@@ -18,7 +18,7 @@ services:
       - DATABASE_PATH=/app/data/annotation_platform.db
     restart: unless-stopped
     healthcheck:
-      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')"]
+      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
       interval: 30s
       timeout: 10s
       retries: 3