Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
.env
.agent
app/data/app.db
api/data/
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# 1. Build Vue Frontend
################################
FROM node:24-alpine AS frontend-builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

WORKDIR /app/web
COPY web/. ./
Expand All @@ -15,14 +13,14 @@ RUN npm install && npm run build
################################
FROM python:3.13-slim

WORKDIR /app
WORKDIR /api

# 拷贝后端
COPY api/ ./

ENV PATH="/app/.venv/bin:$PATH"
ENV PATH="/api/.venv/bin:$PATH"

# 拷贝数据目录(确保 sqlite 文件目录存在) 在容器中的数据保存目录为 /app/data
# 拷贝数据目录(确保 sqlite 文件目录存在) 在容器中的数据保存目录为 /api/data
# 安装后端依赖
RUN mkdir -p data && pip install uv && uv sync

Expand Down
7 changes: 3 additions & 4 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ services:
container_name: archivenote-backend-dev
working_dir: /app
ports:
- "8000:8000"
- "2601:2601"
volumes:
- ./api:/app
- ./app/data:/app/data
environment:
- SECRET_KEY=dev-secret-key-change-in-production
# - DATABASE_URL=sqlite+aiosqlite:///./data/app.db
Expand All @@ -17,7 +16,7 @@ services:
bash -c "pip install uv &&
uv sync &&
uv run python -m alembic upgrade head &&
uv run python -m uvicorn app.app:app --host 0.0.0.0 --port 8000 --reload"
uv run python -m uvicorn app.app:app --host 0.0.0.0 --port 2601 --reload"
restart: unless-stopped

# 前端服务
Expand All @@ -31,7 +30,7 @@ services:
- ./web:/app
- /app/node_modules
environment:
- VITE_API_BASE_URL=http://localhost:8000/api
- VITE_API_BASE_URL=http://localhost:2601/api
command: sh -c "npm install && npm run dev -- --host"
restart: unless-stopped

Expand Down