Hansimov commited on
Commit
ea49401
1 Parent(s): d0a4f07

:boom: [Fix] PermissionError: [Errno 13] Permission denied: /app/files

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -1,7 +1,16 @@
1
  FROM python:3.11-slim
 
 
 
 
 
 
 
 
 
 
2
  WORKDIR $HOME/app
3
- COPY . .
4
- RUN pip install -r requirements.txt
5
- VOLUME /data
6
  EXPOSE 21111
7
  CMD ["python", "-m", "apis.search_api"]
 
1
  FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+ COPY ./requirements.txt /app/requirements.txt
5
+ RUN pip install -r /app/requirements.txt
6
+
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ ENV HOME=/home/user
10
+ ENV PATH=/home/user/.local/bin:$PATH
11
+
12
  WORKDIR $HOME/app
13
+ COPY --chown=user . $HOME/app
14
+
 
15
  EXPOSE 21111
16
  CMD ["python", "-m", "apis.search_api"]