-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathback.Dockerfile
More file actions
29 lines (18 loc) · 1001 Bytes
/
back.Dockerfile
File metadata and controls
29 lines (18 loc) · 1001 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
FROM python:3.12-slim AS dependency
COPY requirements.txt /mb/requirements.txt
WORKDIR /mb
RUN pip install --no-cache-dir --no-compile --upgrade -r requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends binutils && rm -rf /var/lib/apt/lists/*
# RUN find /usr/local/lib/python*/site-packages -type d \( -name "tests" -o -name "test" -o -name "testing" -o -name "__pycache__" \) -not -path "*/numpy/testing" -prune -exec rm -rf {} +
# RUN find /usr/local/lib/python*/site-packages -type f \( -name "*.md" -o -name "*.rst" -o -name "*.txt" \) -not -path "*/pint/*.txt" -delete
RUN find /usr/local/lib/python*/site-packages -name "*.so" -exec strip --strip-unneeded {} +
FROM python:3.12-slim
COPY --from=dependency /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY src/mb /mb/mb
COPY mb_runner.py /mb
WORKDIR /mb
RUN useradd -m runner
USER runner
ENV PYTHONOPTIMIZE=1
ENTRYPOINT ["python3", "mb_runner.py"]
CMD ["host", "0.0.0.0"]