File size: 905 Bytes
32d7e67
 
 
 
 
 
 
 
 
0703c73
 
32d7e67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.8.1

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN apt-get update && \
      apt-get install -y sudo tmux wget curl htop make tree && \
      apt-get install -y iputils-ping telnet && \
      apt-get install -y git git-lfs && \
      apt-get install -y libgl1-mesa-glx

RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true \
      useradd -m -u 1000 user && \
      echo "user:$(cat /run/secrets/PASSWORD)" | chpasswd && \
      adduser user sudo

RUN pip install -U pip pysocks
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

USER user
ENV HOME=/home/user
ENV PATH=$HOME/.local/bin:$PATH
ENV SHELL=/bin/bash

WORKDIR $HOME

COPY --chown=user . $HOME/app

COPY .bashrc $HOME/.bashrc_append
RUN cat $HOME/.bashrc_append >> $HOME/.bashrc && \
      rm $HOME/.bashrc_append

EXPOSE     7860
ENTRYPOINT []
CMD        ["/bin/bash", "./app/run.sh"]