build(docker): 更新 Docker 配置并修改数据库文件路径

- 修改数据库文件路径为 /data/verify.db
- 在 docker-compose.yml 中添加数据卷映射
- 更新 Dockerfile,包含代码克隆、依赖安装和启动命令
This commit is contained in:
liuxiaoqing 2025-08-20 10:29:18 +08:00
parent b122567c12
commit 9a004a3133
3 changed files with 9 additions and 3 deletions

View File

@ -3,7 +3,7 @@ from sqlite3 import Error
class DBService: class DBService:
db_file = "verify.db" db_file = "/data/verify.db"
conn = None conn = None
def __init__(self): def __init__(self):
""" """

View File

@ -5,5 +5,6 @@ services:
container_name: python-app container_name: python-app
volumes: volumes:
- ./:/app - ./:/app
- ./data:/data
ports: ports:
- "5555:5555" # 如果需要暴露 Flask 端口 - "5555:5555" # 如果需要暴露 Flask 端口

View File

@ -1,5 +1,10 @@
FROM python:latest FROM python:latest
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt WORKDIR /app
RUN git clone http://192.168.1.68:8418/jayus/VerifVATInvoice.git .
COPY . .
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
RUN python setup.py install RUN python setup.py install
WORKDIR /app/alibabacloud_sample
CMD ["python", "main.py"]