ccoreilly commited on
Commit
355a767
1 Parent(s): 7ae4987

create user

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -6
Dockerfile CHANGED
@@ -10,18 +10,28 @@ RUN cd espeak-ng && \
10
  make && \
11
  make install
12
 
13
- COPY requirements.txt .
14
- COPY models .
 
 
 
 
 
 
 
 
 
 
15
 
16
  RUN pip install -r requirements.txt
17
 
18
- COPY engine.py .
19
- COPY app.py .
20
 
21
  RUN mkdir -p cache && chmod 777 cache
22
 
23
- ENV NUMBA_CACHE_DIR=./cache
24
- ENV MPLCONFIGDIR=./cache
25
 
26
  EXPOSE 7860
27
 
 
10
  make && \
11
  make install
12
 
13
+ RUN useradd -m -u 1000 user
14
+
15
+ USER user
16
+
17
+ ENV HOME=/home/user \
18
+ PATH=/home/user/.local/bin:$PATH
19
+
20
+ # Set the working directory to the user's home directory
21
+ WORKDIR $HOME/app
22
+
23
+ COPY --chown=user requirements.txt .
24
+ COPY --chown=user models .
25
 
26
  RUN pip install -r requirements.txt
27
 
28
+ COPY --chown=user engine.py .
29
+ COPY --chown=user app.py .
30
 
31
  RUN mkdir -p cache && chmod 777 cache
32
 
33
+ ENV NUMBA_CACHE_DIR=/home/user/cache
34
+ ENV MPLCONFIGDIR=/home/user/cache
35
 
36
  EXPOSE 7860
37