Update Dockerfile
Browse files- Dockerfile +19 -16
Dockerfile
CHANGED
|
@@ -1,23 +1,26 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
# Default values (overridden by Hugging Face secrets at runtime)
|
| 4 |
-
ENV API_KEY=default_key \
|
| 5 |
-
S3_ENDPOINT_URL=https://s3.ap-south-1.amazonaws.com \
|
| 6 |
-
S3_ACCESS_KEY=default_access_key \
|
| 7 |
-
S3_SECRET_KEY=default_secret_key \
|
| 8 |
-
S3_BUCKET_NAME=default_bucket \
|
| 9 |
-
S3_REGION=ap-south-1 \
|
| 10 |
-
MAX_QUEUE_LENGTH=10 \
|
| 11 |
-
GUNICORN_WORKERS=4 \
|
| 12 |
-
GUNICORN_TIMEOUT=300
|
| 13 |
|
|
|
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
|
|
|
|
| 21 |
EXPOSE 8080
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image as the base
|
| 2 |
+
FROM python:3.9-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install dependencies
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy the application code
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Expose the application port
|
| 15 |
EXPOSE 8080
|
| 16 |
|
| 17 |
+
# Define environment variables (these can be overridden in HF Spaces settings)
|
| 18 |
+
ENV API_KEY=default_api_key \
|
| 19 |
+
S3_ENDPOINT_URL=https://s3.amazonaws.com \
|
| 20 |
+
S3_ACCESS_KEY=default_access_key \
|
| 21 |
+
S3_SECRET_KEY=default_secret_key \
|
| 22 |
+
S3_BUCKET_NAME=default_bucket \
|
| 23 |
+
S3_REGION=us-east-1
|
| 24 |
+
|
| 25 |
+
# Start the Flask application
|
| 26 |
+
CMD ["python", "app.py"]
|