Skip to content

Commit

Permalink
fix: 激活虚拟环境
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Jan 7, 2025
1 parent 14422db commit 6841267
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM python:3.11-alpine3.19 AS builder

# 减少 COPY 操作的次数
COPY ./package_list.txt /tmp/
# Install uv.
COPY --from=astral-sh/uv:latest /uv /uvx /bin/

# 安装依赖,安装 rclone 和 mc,清理无用文件
RUN apk add --no-cache $(cat /tmp/package_list.txt) \
Expand Down Expand Up @@ -60,9 +62,7 @@ RUN apk add --no-cache --virtual .build-deps \
&& echo 'fs.inotify.max_user_instances=5242880' >> /etc/sysctl.conf \
&& echo 'vm.overcommit_memory=1' >> /etc/sysctl.conf \
&& echo "nt ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& curl -sSL https://astral.sh/uv/install.sh | sh \
&& . $HOME/.local/bin/env \
&& uv sync \
&& uv sync --frozen --no-cache\
&& apk del --purge .build-deps \
&& rm -rf /tmp/* /root/.cache /var/cache/apk/*

Expand Down
2 changes: 1 addition & 1 deletion docker/rootfs/etc/services.d/config_monitor/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
umask ${UMASK}

exec \
cd ${WORKDIR} s6-setuidgid nt . .venv/bin/activate && python config_monitor.py
cd ${WORKDIR} s6-setuidgid nt .venv/bin/python config_monitor.py
4 changes: 1 addition & 3 deletions start-server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh
# 激活虚拟环境
. .venv/bin/activate
# 启动后创建gunicorn.pid文件
gunicorn run:App -c gunicorn.conf.py
.venv/bin/gunicorn run:App -c gunicorn.conf.py

0 comments on commit 6841267

Please sign in to comment.