Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +34 -34
Dockerfile
CHANGED
|
@@ -1,34 +1,34 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# Install system dependencies
|
| 6 |
-
RUN apt-get update && apt-get install -y \
|
| 7 |
-
gcc \
|
| 8 |
-
g++ \
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
# Copy requirements and install Python dependencies
|
| 12 |
-
COPY requirements.txt .
|
| 13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
-
|
| 15 |
-
# Create necessary directories
|
| 16 |
-
RUN mkdir -p static data
|
| 17 |
-
|
| 18 |
-
# Copy application files
|
| 19 |
-
COPY app.py .
|
| 20 |
-
COPY translations/ translations/
|
| 21 |
-
COPY i18n.py .
|
| 22 |
-
COPY websocket_handler.py .
|
| 23 |
-
COPY static/ static/
|
| 24 |
-
COPY
|
| 25 |
-
|
| 26 |
-
# Create a non-root user
|
| 27 |
-
RUN useradd -m -u 1000 user && chown -R user:user /app
|
| 28 |
-
USER user
|
| 29 |
-
|
| 30 |
-
# Expose port for Hugging Face Spaces
|
| 31 |
-
EXPOSE 7860
|
| 32 |
-
|
| 33 |
-
# Run the application
|
| 34 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
gcc \
|
| 8 |
+
g++ \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Copy requirements and install Python dependencies
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Create necessary directories
|
| 16 |
+
RUN mkdir -p static data
|
| 17 |
+
|
| 18 |
+
# Copy application files
|
| 19 |
+
COPY app.py .
|
| 20 |
+
COPY translations/ translations/
|
| 21 |
+
COPY i18n.py .
|
| 22 |
+
COPY websocket_handler.py .
|
| 23 |
+
COPY static/ static/
|
| 24 |
+
COPY templates/ templates/
|
| 25 |
+
|
| 26 |
+
# Create a non-root user
|
| 27 |
+
RUN useradd -m -u 1000 user && chown -R user:user /app
|
| 28 |
+
USER user
|
| 29 |
+
|
| 30 |
+
# Expose port for Hugging Face Spaces
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# Run the application
|
| 34 |
+
CMD ["python", "app.py"]
|