File size: 925 Bytes
8f9c4ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ─────────────────────────────────────────────────────────────
# Sandbox Dockerfile β€” JavaScript/TypeScript execution
# Minimal image with strict security constraints
# ─────────────────────────────────────────────────────────────

FROM node:20-alpine

# Create sandbox user (non-root)
RUN adduser -D -u 1000 sandbox

# Create workspace
RUN mkdir -p /sandbox && chown sandbox:sandbox /sandbox

# Install TypeScript runtime
RUN npm install -g tsx typescript

# Remove package manager to prevent installs
RUN rm -rf /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack

# Switch to sandbox user
USER sandbox
WORKDIR /sandbox

# Default entrypoint
ENTRYPOINT ["sh", "-c"]