vumichien commited on
Commit
df1c32c
·
1 Parent(s): 7e8406a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -1,22 +1,26 @@
1
  FROM python:3.9
2
 
3
- WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- RUN useradd -m -u 1000 user
10
 
11
- USER user
 
12
 
13
- ENV HOME=/home/user \
14
- PATH=/home/user/.local/bin:$PATH
15
 
16
- WORKDIR $HOME/app
 
 
17
 
18
- COPY . .
 
 
19
 
20
- COPY --chown=user . $HOME/app
21
 
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
 
3
+ WORKDIR /content
4
 
5
+ RUN mkdir /content/cache/
6
 
7
+ RUN export TRANSFORMERS_CACHE=/content/cache/
8
 
9
+ COPY ./requirements.txt /content/requirements.txt
10
 
11
+ RUN pip install --no-cache-dir --upgrade -r /content/requirements.txt
12
+ RUN apt-get update && apt-get install -y ffmpeg
13
 
14
+ COPY . .
 
15
 
16
+ RUN adduser --disabled-password --gecos '' admin
17
+ RUN adduser admin sudo
18
+ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
19
 
20
+ RUN chown -R admin:admin /content
21
+ RUN chmod -R 777 /content
22
+ USER admin
23
 
24
+ EXPOSE 7860
25
 
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]