Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -6,18 +6,19 @@ RUN useradd -m -u 1000 user
|
|
| 6 |
# Set working directory
|
| 7 |
WORKDIR /app
|
| 8 |
RUN mkdir -p /app/static/plots && chown -R user:user /app/static
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy the
|
| 14 |
COPY --chown=user . .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
USER user
|
| 18 |
|
| 19 |
-
# Expose
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
# Run
|
| 23 |
-
CMD ["
|
|
|
|
| 6 |
# Set working directory
|
| 7 |
WORKDIR /app
|
| 8 |
RUN mkdir -p /app/static/plots && chown -R user:user /app/static
|
| 9 |
+
|
| 10 |
+
# Copy dependencies and install
|
| 11 |
+
COPY --chown=user requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
|
| 14 |
+
# Copy the full app
|
| 15 |
COPY --chown=user . .
|
| 16 |
|
| 17 |
+
# Switch to non-root user
|
| 18 |
USER user
|
| 19 |
|
| 20 |
+
# Expose port Hugging Face expects
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# Run Flask app using Gunicorn on port 7860
|
| 24 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|