Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +2 -17
Dockerfile
CHANGED
|
@@ -7,31 +7,16 @@ WORKDIR /app
|
|
| 7 |
# Copy the requirements.txt file first to leverage Docker's build cache.
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
-
# Install Python dependencies (
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Install Nginx and other necessary packages
|
| 14 |
-
RUN apt-get update && apt-get install -y nginx && \
|
| 15 |
-
rm -rf /var/lib/apt/lists/*
|
| 16 |
-
|
| 17 |
-
# Create and set permissions for all Nginx cache/temp directories needed.
|
| 18 |
-
# Nginx typically runs as the 'www-data' user, which needs write access.
|
| 19 |
-
RUN mkdir -p /tmp/nginx_cache/client_body && \
|
| 20 |
-
mkdir -p /tmp/nginx_cache/proxy && \
|
| 21 |
-
chown -R www-data:www-data /tmp/nginx_cache && \
|
| 22 |
-
chmod -R 755 /tmp/nginx_cache
|
| 23 |
-
|
| 24 |
# Copy the entire project directory into the container's /app directory.
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
-
# Replace the default Nginx configuration with your custom one.
|
| 28 |
-
# This nginx.conf MUST be updated as shown in Step 3 to use the new paths and logging.
|
| 29 |
-
COPY nginx.conf /etc/nginx/nginx.conf
|
| 30 |
-
|
| 31 |
# Grant execution permissions to the start.sh script
|
| 32 |
RUN chmod +x start.sh
|
| 33 |
|
| 34 |
-
# Expose the port
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
# Define the command to run when the container starts.
|
|
|
|
| 7 |
# Copy the requirements.txt file first to leverage Docker's build cache.
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# Install Python dependencies (including gunicorn, Flask, Streamlit, etc.)
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# Copy the entire project directory into the container's /app directory.
|
| 14 |
COPY . .
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Grant execution permissions to the start.sh script
|
| 17 |
RUN chmod +x start.sh
|
| 18 |
|
| 19 |
+
# Expose the port Streamlit will listen on directly (7860 for Hugging Face Spaces)
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
# Define the command to run when the container starts.
|