-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (24 loc) · 1.06 KB
/
Dockerfile
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
# Edit the base image here, e.g. to use
# Tensorflow: https://hub.docker.com/r/tensorflow/tensorflow/
# Pytorch: https://hub.docker.com/r/pytorch/pytorch/
# For Pytorch e.g.: FROM pytorch/pytorch:1.6.0-cuda10.1-cudnn7-runtime
# Or list your pip packages in requirements.txt and install them
FROM python:3.10-slim
# Create the user
RUN groupadd -r user && useradd -m --no-log-init -r -g user user
RUN mkdir -p /opt/app /input /output \
&& chown user:user /opt/app /input /output
USER user
WORKDIR /opt/app
ENV PATH="/home/user/.local/bin:${PATH}"
RUN python -m pip install --user -U pip
# All required files are copied to the Docker container
COPY --chown=user:user requirements.txt /opt/app/
COPY --chown=user:user process.py /opt/app/
COPY --chown=user:user base_algorithm.py /opt/app/
# COPY --chown=user:user <somefile> /opt/app/
# ...
# Install required python packages via pip from your requirements.txt
RUN python -m pip install --user -r requirements.txt
# Entrypoint to your python code - executes process.py as a script
ENTRYPOINT [ "python", "-m", "process" ]