update docker dev.yml

This commit is contained in:
XIE7654
2025-07-13 21:42:25 +08:00
parent f5314efc81
commit badba2662f
5 changed files with 55 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ COPY . .
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
# 入口命令由 docker-compose 控制
# 数据库迁移
RUN python manage.py makemigrations && python manage.py migrate
#RUN python manage.py makemigrations && python manage.py migrate
# 收集静态文件
RUN python manage.py collectstatic --noinput
@@ -26,7 +26,9 @@ RUN python manage.py collectstatic --noinput
FROM base AS dev
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
#CMD ["tail", "-f", "/dev/null"]
#CMD ["daphne", "backend.asgi:application"]
# CMD ["sh", "-c", "sleep 5 && python manage.py runserver 0.0.0.0:8000"]

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.2.1 on 2025-07-13 12:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ai', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='chatrole',
name='knowledge',
field=models.ManyToManyField(blank=True, related_name='roles', to='ai.knowledge', verbose_name='关联的知识库'),
),
migrations.AlterField(
model_name='chatrole',
name='tools',
field=models.ManyToManyField(blank=True, related_name='roles', to='ai.tool', verbose_name='关联的工具'),
),
]

View File

@@ -18,4 +18,5 @@ django-ninja==1.4.3
openai==1.95
daphne==4.2.1
langchain==0.3.26
langchain-community==0.3.27
langchain-community==0.3.27
channels==4.2.2

View File

@@ -91,6 +91,10 @@ services:
depends_on:
db:
condition: service_healthy
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
daphne -b 0.0.0.0 backend.asgi:application"
web:
build:

View File

@@ -5,23 +5,33 @@ FROM node:22.17.0 AS base
WORKDIR /app
ENV PNPM_SKIP_PROMPT=true
ENV CI=true
RUN corepack enable && corepack prepare pnpm@10.10.0 --activate
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
#
RUN pnpm install --frozen-lockfile
# 拷贝项目
COPY . .
#RUN pnpm i
# 安装 pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# 清理依赖缓存
RUN pnpm store prune && rm -rf $(pnpm store path) && \
rm -rf node_modules .npmrc package-lock.json pnpm-lock.yaml .pnpm-store .turbo && \
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
RUN npm run clean
# 安装依赖
RUN pnpm install --force
#RUN corepack enable && corepack prepare pnpm@latest --activate
#
## 清理依赖缓存
#RUN pnpm store prune && rm -rf $(pnpm store path) && \
# rm -rf node_modules .npmrc package-lock.json pnpm-lock.yaml .pnpm-store .turbo && \
# find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
#
##RUN pnpm run clean
#
## 安装依赖
##RUN pnpm install --force
@@ -33,7 +43,7 @@ FROM base AS dev
# 暴露端口(根据需要)
EXPOSE 5678
# CMD ["tail", "-f", "/dev/null"]
#CMD ["tail", "-f", "/dev/null"]
# 启动开发服务器
CMD ["npm", "run", "dev:antd"]