aertit commited on
Commit
6beaa19
1 Parent(s): 6c1d009

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN apt-get update && \
8
+ apt-get install -y sudo tmux make tree && \
9
+ apt-get install -y iputils-ping && \
10
+ apt-get install -y git git-lfs
11
+
12
+ RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true \
13
+ useradd -m -u 1000 user && \
14
+ echo "user:$(cat /run/secrets/PASSWORD)" | chpasswd && \
15
+ adduser user sudo
16
+
17
+ RUN pip install -U pip pysocks
18
+ RUN pip install diffusers["torch"] transformers && \
19
+ pip install diffusers["flax"] transformers
20
+
21
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
22
+ USER user
23
+ ENV HOME=/home/user
24
+ ENV PATH=$HOME/.local/bin:$PATH
25
+ ENV SHELL=/bin/bash
26
+
27
+ WORKDIR $HOME
28
+
29
+ COPY --chown=user . $HOME/app
30
+
31
+ COPY .bashrc $HOME/.bashrc_append
32
+ RUN cat $HOME/.bashrc_append >> $HOME/.bashrc && \
33
+ rm $HOME/.bashrc_append
34
+
35
+ EXPOSE 7860
36
+ ENTRYPOINT []
37
+ CMD ["/bin/bash", "./app/entrypoint.sh"]