Docker Base Image Begin
This commit is contained in:
51
docker/Dockerfile
Normal file
51
docker/Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
ARG FROM_IMAGE
|
||||
ARG H_GID
|
||||
ARG H_UID
|
||||
ARG PIP_REQ_FILE
|
||||
|
||||
FROM $FROM_IMAGE
|
||||
|
||||
RUN apt update && \
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y tzdata \
|
||||
&& cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
|
||||
&& echo "Europe/Berlin" > /etc/timezone
|
||||
|
||||
RUN apt install -y bash \
|
||||
build-essential \
|
||||
git \
|
||||
curl \
|
||||
ca-certificates \
|
||||
python3-dev \
|
||||
python3-pip
|
||||
|
||||
RUN ln -s /usr/bin/python3 /usr/local/bin/python \
|
||||
&& addgroup --gid $H_GID user \
|
||||
&& adduser user --uid $H_UID --ingroup user --gecos "" --home /home/user/ --disabled-password
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
bash nano vim mc \
|
||||
curl wget \
|
||||
htop screen
|
||||
|
||||
RUN python3 -m pip install --no-cache-dir --break-system-packages \
|
||||
torch --index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
RUN mkdir /ums-agenten/
|
||||
|
||||
ENV NLTK_DATA=/ums-agenten/nltk/
|
||||
ENV HF_HOME=/ums-agenten/hf_home/
|
||||
|
||||
COPY ./docker/$PIP_REQ_FILE /ums-agenten/requirements.txt
|
||||
RUN pip3 install --break-system-packages --no-cache-dir -r /ums-agenten/requirements.txt \
|
||||
&& python -m pip freeze > /ums-agenten/requirements.txt
|
||||
|
||||
COPY ./docker/init.py /ums-agenten/project/
|
||||
COPY ./docker/setup.py /ums-agenten/project/
|
||||
RUN pip3 install --break-system-packages -e /ums-agenten/project/
|
||||
|
||||
WORKDIR /ums-agenten/project/src/
|
||||
RUN chown -R user:user /ums-agenten
|
||||
USER user
|
||||
|
||||
CMD ["/bin/bash"]
|
Reference in New Issue
Block a user