-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
40 lines (29 loc) · 1.09 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
# ---- Build Stage ----
FROM python:3.11 AS builder
WORKDIR /app
COPY pyproject.toml README.md /app/
COPY core /app/core
COPY meta_rl /app/meta_rl
COPY env_runner /app/env_runner
COPY adaptation /app/adaptation
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir build && \
python -m build --wheel --outdir dist .
# ---- Final Stage ----
FROM python:3.11-slim
WORKDIR /app
# Install system deps required by gymnasium/mujoco
RUN apt-get update && \
apt-get install -y --no-install-recommends libgl1 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && \
rm /tmp/*.whl
# Copy application scripts (main, experiments, etc.)
COPY main.py /app/main.py
COPY experiments /app/experiments
# No ENTRYPOINT, allow user to specify script via docker run command
# Example: docker run <image_name> python main.py --env_name Pendulum-v1
# Example: docker run <image_name> python experiments/quick_benchmark.py
# Default command (optional, can be overridden)
CMD ["python", "main.py", "--help"]