JoelJokku commited on
Commit
63bfed8
·
1 Parent(s): e0f07e3

Updated codes

Browse files
Files changed (1) hide show
  1. dockerfile +9 -6
dockerfile CHANGED
@@ -1,10 +1,13 @@
1
  FROM python:3.11-slim
2
-
3
  RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
 
 
 
 
4
  WORKDIR /app
5
- COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
-
8
- COPY . .
9
- EXPOSE 5000
10
- CMD [ "python","app.py" ]
 
1
  FROM python:3.11-slim
 
2
  RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
3
+ RUN useradd -m -u 1000 appuser
4
+ USER appuser
5
+ ENV XDG_CACHE_HOME=/app/.cache
6
+ ENV PYTHONUNBUFFERED=1
7
  WORKDIR /app
8
+ COPY --chown=appuser requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
+ COPY --chown=appuser . .
11
+ RUN mkdir -p .cache && chmod 755 .cache
12
+ EXPOSE 7860
13
+ CMD ["python", "app.py"]