-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (56 loc) · 1.99 KB
/
Dockerfile
File metadata and controls
67 lines (56 loc) · 1.99 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
# syntax=docker/dockerfile:1.7
FROM python:3.13-slim-bookworm
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
# Keep downloaded debs in the BuildKit cache mount across rebuilds.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && \
apt-get install --no-install-recommends -y \
git \
procps \
curl \
ripgrep \
jq \
less \
unzip \
zip \
file \
fd-find \
tree \
ca-certificates \
gnupg \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libharfbuzz-subset0 \
libgdk-pixbuf2.0-0 \
libcairo2 && \
install -d -m 0755 /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install --no-install-recommends -y nodejs && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip uv
COPY pyproject.toml README.md ./
COPY __init__.py ./__init__.py
COPY server ./server
COPY sandbox_utils.py logging_config.py ./
RUN --mount=type=cache,target=/root/.cache/pip \
pip install .
COPY . ./
ARG GIT_COMMIT=unknown
RUN echo "${GIT_COMMIT}" > /app/.git-commit
RUN addgroup --system appgroup && \
adduser --system --ingroup appgroup appuser && \
mkdir -p /tmp/.npm /tmp/.cache /runtime-cache /workspace && \
chown -R appuser:appgroup /tmp/.npm /tmp/.cache /runtime-cache /workspace
ENV HOME=/tmp \
NPM_CONFIG_CACHE=/tmp/.npm \
npm_config_cache=/tmp/.npm \
XDG_CACHE_HOME=/tmp/.cache \
SANDBOX_RUNTIME_CACHE_ROOT=/runtime-cache
USER appuser
EXPOSE 8080
CMD ["gunicorn", "sandbox_server:application", "--bind", "0.0.0.0:8080", "--workers", "1", "--threads", "4", "--timeout", "0"]