-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (48 loc) · 1.69 KB
/
Dockerfile
File metadata and controls
63 lines (48 loc) · 1.69 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
# JaSketch - Modern Whiteboard Application
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
ca-certificates \
python3-gdbm \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 20.x for client-side dependencies
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install Jac packages from PyPI
RUN pip install --no-cache-dir jaclang jac-client jac-scale[all] byllm
# Install Bun (required for jac client-side dependencies)
RUN curl -fsSL https://bun.sh/install | bash && \
mv /root/.bun/bin/bun /usr/local/bin/bun && \
chmod +x /usr/local/bin/bun
# Copy application code
COPY . /app
# Install MCP relay (Jac/Python)
RUN pip install --no-cache-dir -e /app/mcp-server
# Install client-side npm dependencies and project dependencies
RUN jac clean --all --force
RUN jac add --npm && jac install
RUN jac setup pwa
# Set environment variables
ENV PORT=8000 \
HOST=0.0.0.0 \
DEBUG=false \
LOG_LEVEL=info \
PYTHONUNBUFFERED=1 \
JASKETCH_RELAY_PORT=9601
# Create non-root user for security
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
# Pre-warm Jac bytecode cache as appuser (avoids cold-start recompilation at runtime)
RUN python -c "import jaclang" || true
EXPOSE 8000 9601 9602
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=5 \
CMD curl -f http://localhost:8000/ || exit 1
# Run jac app with embedded relay (started via JASKETCH_START_RELAY=true in main.jac)
CMD jac start --client pwa