-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.local
More file actions
70 lines (57 loc) · 1.78 KB
/
Copy pathDockerfile.local
File metadata and controls
70 lines (57 loc) · 1.78 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Dockerfile.local - All-in-one container for Draft local/demo mode
#
# This Dockerfile bundles everything needed to run Draft:
# - Redis (optional, uses in-memory fallback by default)
# - Python backend (FastAPI)
# - Celery worker
# - Node.js frontend (built and served)
# - Supervisor to manage all processes
#
# Usage: docker compose up
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
# Node.js for frontend
curl \
gnupg \
# Redis for caching (optional in local mode)
redis-server \
# Git for worktree operations
git \
# Supervisor for process management
supervisor \
# Build essentials
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 20.x
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Create workspace
WORKDIR /workspace
# Copy project files
COPY backend/ /workspace/backend/
COPY frontend/ /workspace/frontend/
COPY demo-repo/ /workspace/demo-repo/
COPY draft.yaml /workspace/draft.yaml
COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY start.sh /workspace/start.sh
# Install backend dependencies
WORKDIR /workspace/backend
RUN pip install --no-cache-dir -r requirements.txt
# Install frontend dependencies and build
WORKDIR /workspace/frontend
RUN npm install && npm run build
# Create log directories
RUN mkdir -p /var/log/supervisor /workspace/data/logs
# Make start script executable
RUN chmod +x /workspace/start.sh
# Expose ports
EXPOSE 3000 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Set working directory
WORKDIR /workspace
# Start everything
CMD ["/workspace/start.sh"]