Commit 4d1057e8 by 陈正乐

镜像创建,容器启动

parent c88f6743
# 使用官方的Python 3.10基础镜像
FROM python:3.10
# 设置工作目录
WORKDIR /app
# 复制当前目录下的所有文件到工作目录
COPY . /app
# 配置pip使用清华镜像源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 配置python环境
RUN pip install --no-cache-dir -r requirements.txt
# 运行一个简单的Python命令以确保环境正确配置
CMD ["python", "--version"]
version: '3'
services:
postgres:
image: postgres
container_name: lae_pgsql
environment:
POSTGRES_PASSWORD: 111111
ports:
- "5433:5432"
volumes:
- ./lae_pg_data:/var/lib/postgresql/data
- ./init_db:/docker-entrypoint-initdb.d
python:
build:
context: .
dockerfile: Dockerfile
image: lae_python_image:3.10
container_name: lae_python
volumes:
- .:/app
ports:
- "8003:8003"
stdin_open: true
tty: true
command: /bin/bash
volumes:
lae_pg_data:
...@@ -126,7 +126,7 @@ def main(): ...@@ -126,7 +126,7 @@ def main():
return history return history
def clear_tip(his): def clear_tip(his):
if not his[0][0] and his[0][1] == "我是新晨科技股份有限公司开发的人工智能助手,名叫小晨,如果您有任何问题,欢迎随时向我咨询": if not his[0][0] and his[0][1] == "你好,我是新晨科技股份的人工智能助手小晨,如果您有低空经济相关问题,欢迎随时向我咨询。":
return his[1:] return his[1:]
else: else:
return his return his
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment