Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
image_search
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
service
image_search
Commits
256977d0
Commit
256977d0
authored
Jun 04, 2025
by
zhengyaoqiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
5cdbaddd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
.dockerignore
.dockerignore
+5
-0
Dockerfile
Dockerfile
+42
-0
No files found.
.dockerignore
0 → 100644
View file @
256977d0
*.pth
*.pt
*.png
*.jpg
venv
\ No newline at end of file
Dockerfile
0 → 100644
View file @
256977d0
FROM
python:3.13-slim AS dependencies
WORKDIR
/app
# 安装系统依赖(CLIP需要)
RUN
apt-get update
&&
apt-get
install
-y
\
git
\
&&
rm
-rf
/var/lib/apt/lists/
*
# 设置环境变量
ENV
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# 先安装基础依赖
COPY
requirements.txt .
RUN
pip
install
--no-cache-dir
--upgrade
pip
# 安装 CLIP
RUN
pip
install
--no-cache-dir
git+https://github.com/openai/CLIP.git
# 安装其他依赖
RUN
pip
install
--no-cache-dir
-r
requirements.txt
# 第二阶段:运行时环境
FROM
python:3.13-slim AS runtime
WORKDIR
/app
# 设置环境变量
ENV
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# 从第一阶段复制已安装的包
COPY
--from=dependencies /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY
--from=dependencies /usr/local/bin /usr/local/bin
# 复制应用代码(放在最后,避免代码变更影响依赖缓存)
COPY
. .
EXPOSE
5000
CMD
["python", "run.py"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment