Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -1
Dockerfile
CHANGED
|
@@ -2,8 +2,13 @@ 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 mkdir /.cache && chmod 777 /.cache
|
|
@@ -14,10 +19,12 @@ RUN chmod 777 /code
|
|
| 14 |
# Set permissions for the database file
|
| 15 |
RUN touch /code/users.db && chmod 777 /code/users.db
|
| 16 |
|
| 17 |
-
RUN
|
| 18 |
|
| 19 |
RUN chmod 777 temp_mentor.txt
|
| 20 |
|
|
|
|
|
|
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "--timeout", "300", "main:app"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
+
RUN chown -R user:user /code
|
| 11 |
+
|
| 12 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 13 |
|
| 14 |
RUN mkdir /.cache && chmod 777 /.cache
|
|
|
|
| 19 |
# Set permissions for the database file
|
| 20 |
RUN touch /code/users.db && chmod 777 /code/users.db
|
| 21 |
|
| 22 |
+
RUN chmod 777 temp_mentor.txt
|
| 23 |
|
| 24 |
RUN chmod 777 temp_mentor.txt
|
| 25 |
|
| 26 |
+
COPY --chown=user:user . /code
|
| 27 |
+
|
| 28 |
COPY . .
|
| 29 |
|
| 30 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "--timeout", "300", "main:app"]
|