-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
48 lines (37 loc) · 1.45 KB
/
Dockerfile.dev
File metadata and controls
48 lines (37 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Development Dockerfile for BookOtter
# Optimized for fast iteration with Docker Compose watch
FROM python:3.14-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
BOOKOTTER_DATA_DIR=/app/data
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js for frontend development
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy frontend package files and install
COPY frontend/package.json frontend/pnpm-lock.yaml ./frontend/
RUN cd frontend && pnpm install --frozen-lockfile
# Copy source files (watch will sync changes on top of these)
COPY backend/ ./backend/
COPY frontend/src/ ./frontend/src/
COPY frontend/index.html ./frontend/
COPY frontend/*.config.* ./frontend/
COPY frontend/tsconfig*.json ./frontend/
# Create data directory
RUN mkdir -p /app/data
# Expose ports (6887 for backend, 5173 for Vite dev server)
EXPOSE 6887 5173
# Default command runs both frontend and backend in dev mode
# Override this in docker-compose for individual services
CMD ["sh", "-c", "cd frontend && pnpm dev --host & uvicorn backend.main:app --host 0.0.0.0 --port 6887 --reload"]