fix: offline deploy
This commit is contained in:
+3
-1
@@ -2,6 +2,8 @@ FROM python-base:3.12
|
|||||||
|
|
||||||
ENV UV_HTTP_TIMEOUT=300
|
ENV UV_HTTP_TIMEOUT=300
|
||||||
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||||
|
ENV UV_OFFLINE=1
|
||||||
|
ENV UV_NO_SYNC=1
|
||||||
|
|
||||||
COPY common/pyproject.toml common/pyproject.toml
|
COPY common/pyproject.toml common/pyproject.toml
|
||||||
COPY backend/pyproject.toml backend/pyproject.toml
|
COPY backend/pyproject.toml backend/pyproject.toml
|
||||||
@@ -17,4 +19,4 @@ RUN uv sync --frozen --no-dev --package backend
|
|||||||
|
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
CMD ["gunicorn", "--config", "backend/gunicorn.conf.py", "backend.main:app"]
|
CMD ["uv", "run", "--frozen", "--no-dev", "--package", "backend", "gunicorn", "--config", "backend/gunicorn.conf.py", "backend.main:app"]
|
||||||
|
|||||||
+7
-6
@@ -3,6 +3,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
|
image: model-development-backend:latest
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
@@ -13,6 +14,7 @@ services:
|
|||||||
- uv
|
- uv
|
||||||
- run
|
- run
|
||||||
- --frozen
|
- --frozen
|
||||||
|
- --no-dev
|
||||||
- --package
|
- --package
|
||||||
- backend
|
- backend
|
||||||
- alembic
|
- alembic
|
||||||
@@ -26,6 +28,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: frontend/Dockerfile
|
dockerfile: frontend/Dockerfile
|
||||||
|
image: model-development-web:latest
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
@@ -59,6 +62,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
|
image: model-development-backend:latest
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
@@ -110,6 +114,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: runtime/Dockerfile
|
dockerfile: runtime/Dockerfile
|
||||||
|
image: model-development-runtime:latest
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
@@ -154,12 +159,7 @@ services:
|
|||||||
# bind mount instead. In s3 mode the grep succeeds (mount must be up or
|
# bind mount instead. In s3 mode the grep succeeds (mount must be up or
|
||||||
# startup would have crashed). In local mode the grep fails (no fuse.rclone)
|
# startup would have crashed). In local mode the grep fails (no fuse.rclone)
|
||||||
# so the || branch runs: just verify /data/workspace is a directory.
|
# so the || branch runs: just verify /data/workspace is a directory.
|
||||||
test:
|
test: [ "CMD-SHELL", "curl -fsS http://127.0.0.1:8000/api/v1/health >/dev/null" ]
|
||||||
- CMD-SHELL
|
|
||||||
- |
|
|
||||||
grep -q ' /data/workspace .* - fuse.rclone ' /proc/self/mountinfo \
|
|
||||||
&& curl -fsS http://127.0.0.1:8000/api/v1/health \
|
|
||||||
|| { [ -d /data/workspace ] && curl -fsS http://127.0.0.1:8000/api/v1/health; }
|
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 18
|
retries: 18
|
||||||
@@ -169,6 +169,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: schedule/Dockerfile
|
dockerfile: schedule/Dockerfile
|
||||||
|
image: model-development-schedule:latest
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
|||||||
+3
-1
@@ -2,6 +2,8 @@ FROM python-base:3.12
|
|||||||
|
|
||||||
ENV UV_HTTP_TIMEOUT=300
|
ENV UV_HTTP_TIMEOUT=300
|
||||||
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||||
|
ENV UV_OFFLINE=1
|
||||||
|
ENV UV_NO_SYNC=1
|
||||||
|
|
||||||
# 从官方 Rclone 镜像直接复制 rclone 二进制文件(高效、稳定)
|
# 从官方 Rclone 镜像直接复制 rclone 二进制文件(高效、稳定)
|
||||||
COPY --from=rclone/rclone:latest /usr/local/bin/rclone /usr/local/bin/rclone
|
COPY --from=rclone/rclone:latest /usr/local/bin/rclone /usr/local/bin/rclone
|
||||||
@@ -44,4 +46,4 @@ RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \
|
|||||||
|
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
CMD ["uv", "run", "--frozen", "--package", "runtime", "gunicorn", "--config", "runtime/gunicorn.conf.py", "runtime.main:app"]
|
CMD ["uv", "run", "--frozen", "--no-dev", "--package", "runtime", "gunicorn", "--config", "runtime/gunicorn.conf.py", "runtime.main:app"]
|
||||||
|
|||||||
+3
-1
@@ -2,6 +2,8 @@ FROM python-base:3.12
|
|||||||
|
|
||||||
ENV UV_HTTP_TIMEOUT=300
|
ENV UV_HTTP_TIMEOUT=300
|
||||||
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||||
|
ENV UV_OFFLINE=1
|
||||||
|
ENV UV_NO_SYNC=1
|
||||||
|
|
||||||
COPY pyproject.toml uv.lock ./
|
COPY pyproject.toml uv.lock ./
|
||||||
COPY common/pyproject.toml common/pyproject.toml
|
COPY common/pyproject.toml common/pyproject.toml
|
||||||
@@ -35,4 +37,4 @@ RUN uv venv --python 3.8 /opt/venv/python3.8 && \
|
|||||||
--display-name="Python 3.8"
|
--display-name="Python 3.8"
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
CMD ["uv", "run", "--frozen", "--package", "schedule", "gunicorn", "--config", "schedule/gunicorn.conf.py", "schedule.main:app"]
|
CMD ["uv", "run", "--frozen", "--no-dev", "--package", "schedule", "gunicorn", "--config", "schedule/gunicorn.conf.py", "schedule.main:app"]
|
||||||
|
|||||||
Reference in New Issue
Block a user