forked from Ali-Gatorre/python-maker-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (26 loc) · 932 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (26 loc) · 932 Bytes
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
# Use a lightweight Python image
FROM python:3.12-slim
# Install bash (for venv setup scripts) and ensure venv module is available
RUN apt-get update && apt-get install -y --no-install-recommends bash \
&& rm -rf /var/lib/apt/lists/*
# Pre-bake common data science and utility libraries so they don't need to be
# installed on every ephemeral container execution. This dramatically speeds up
# runs that depend on popular packages.
RUN pip install --no-cache-dir \
numpy \
pandas \
matplotlib \
scikit-learn \
scipy \
requests \
flask \
pygame \
Pillow
# Set a non-root user for security
RUN useradd -m sandboxuser
# Create the scripts mount point
RUN mkdir -p /home/sandboxuser/scripts && chown sandboxuser:sandboxuser /home/sandboxuser/scripts
USER sandboxuser
WORKDIR /home/sandboxuser
# Default command — overridden by the Rust code at runtime
CMD ["python3", "scripts/script.py"]