Toggle navigation
Toggle navigation
This project
Loading...
Sign in
lizhengwei
/
aigc-embedding-service
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangdongxu
2026-04-14 18:11:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d91dc7ad6ca135abef6e4986d181c93f4c2c7c45
d91dc7ad
1 parent
7c3f7eb5
jira:NYJ-1460 desc:添加dockerfile
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
21 deletions
.dockerignore
Dockerfile
Dockerfile_use_base
dockerfiles/Dockerfile_base260402
main.py
pyproject.toml
.dockerignore
0 → 100644
View file @
d91dc7a
# Git
.git
.gitignore
# IDE
.idea
.vscode
*.swp
*.swo
# Python
__pycache__
*.py[cod]
*$py.class
*.so
.Python
.venv
venv/
# Cache
.ruff_cache
.mypy_cache
.pytest_cache
.cache
# Logs
logs/
*.log
# Docker
dockerfiles/
Dockerfile
.dockerignore
...
...
Dockerfile
View file @
d91dc7a
FROM aigc-embedding-service-base:latest
ENV PROJECT_ROOT=/app ENV=docker
FROM python:3.12-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai PROJECT_ROOT=/app ENV=docker APP_LOG_TYPE=file,console
# 使用 Debian 的阿里云镜像
RUN echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free" >> /etc/apt/sources.list
# 安装系统依赖
RUN apt update && apt install -y --no-install-recommends gcc curl vim && rm -rf /var/lib/apt/lists/*
# 安装uv工具
RUN pip install --no-cache-dir uv
WORKDIR /app
COPY app/ ./app/
COPY . .
RUN uv pip install --system --no-cache ".[es,postgres]"
EXPOSE 8000
CMD ["python", "main.py"]
CMD ["python", "main.py"]
\ No newline at end of file
...
...
Dockerfile_use_base
0 → 100644
View file @
d91dc7a
FROM baselib/aigc-embedding-service:base26402
ENV PROJECT_ROOT=/app ENV=docker APP_LOG_TYPE=file,console
WORKDIR /app
# 复制代码文件
COPY . .
EXPOSE 8000
CMD ["python", "main.py"]
...
...
dockerfiles/Dockerfile_base260402
View file @
d91dc7a
...
...
@@ -4,16 +4,10 @@ FROM python:3.12-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
RUN cat > /etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
EOF
# 使用 Debian 的阿里云镜像
RUN echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free" >> /etc/apt/sources.list
# 安装系统依赖
RUN apt-get update && apt-get install -y --no-install-recommends gcc curl vim && rm -rf /var/lib/apt/lists/*
...
...
@@ -21,8 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends gcc curl vim &&
# 安装uv工具
RUN pip install --no-cache-dir uv
WORKDIR /app
# 复制依赖文件
COPY ../pyproject.toml uv.lock ./
# 使用uv安装项目依赖(包含es和postgres可选依赖)
RUN uv pip install --system --no-cache -e ".[es,postgres]"
\ No newline at end of file
# 复制依赖文件(从构建上下文根目录复制)
COPY pyproject.toml uv.lock ./
RUN uv pip install --system --no-cache ".[es,postgres]"
\ No newline at end of file
...
...
main.py
View file @
d91dc7a
import
os
from
pathlib
import
Path
os
.
environ
[
'PROJECT_ROOT'
]
=
Path
(
__file__
)
.
parent
.
absolute
()
.
as_posix
()
from
aabd.base.patched_logging
import
set_global_logger
,
get_logger
if
not
os
.
environ
.
get
(
"PROJECT_ROOT"
):
os
.
environ
[
'PROJECT_ROOT'
]
=
Path
(
__file__
)
.
parent
.
absolute
()
.
as_posix
()
from
aabd.base.patched_logging
import
init_logging
,
get_logger
set_global_logger
()
init_logging
()
logger
=
get_logger
(
__name__
)
from
contextlib
import
asynccontextmanager
...
...
pyproject.toml
View file @
d91dc7a
...
...
@@ -11,6 +11,7 @@ dependencies = [
"path==17.1.1"
,
"omegaconf==2.3.0"
,
"elasticsearch>=9.3.0"
,
"packaging==26.0"
,
]
[project.optional-dependencies]
...
...
@@ -50,3 +51,6 @@ testpaths = ["tests"]
python_files
=
["test_*.py"]
python_classes
=
["Test*"]
python_functions
=
["test_*"]
[tool.setuptools]
packages
=
[]
...
...
Please
register
or
login
to post a comment