Spaces:
Sleeping
Sleeping
Update Docker file and give permission to user to write access in docker image
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# Use an official Python 3.12 runtime as a parent image
|
| 2 |
-
FROM python:3.12
|
| 3 |
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
|
@@ -23,12 +23,14 @@ COPY . /app
|
|
| 23 |
|
| 24 |
# Set environment variables
|
| 25 |
ENV FLASK_APP=run.py
|
| 26 |
-
ENV FLASK_ENV=
|
| 27 |
-
ENV YOLO_CONFIG_DIR=/
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
# Expose the port the app runs on
|
| 30 |
# Expose the port the app runs on
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
# Define the command to run the application
|
| 34 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "run:app"]
|
|
|
|
| 1 |
# Use an official Python 3.12 runtime as a parent image
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
|
|
|
| 23 |
|
| 24 |
# Set environment variables
|
| 25 |
ENV FLASK_APP=run.py
|
| 26 |
+
ENV FLASK_ENV=production
|
| 27 |
+
ENV YOLO_CONFIG_DIR=/app
|
| 28 |
+
|
| 29 |
+
# Set permissions for the application directory
|
| 30 |
+
RUN chmod -R 777 /app
|
| 31 |
|
|
|
|
| 32 |
# Expose the port the app runs on
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
# Define the command to run the application
|
| 36 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "run:app"]
|