priaansh commited on
Commit
3a2983f
·
verified ·
1 Parent(s): 669eda2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -18
Dockerfile CHANGED
@@ -1,23 +1,30 @@
1
- # Use the official Python image as base
2
  FROM stephengpope/no-code-architects-toolkit:latest
3
 
4
- # Set environment variables
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
 
7
 
8
- # Set work directory
9
- WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- # Install Python dependencies
12
- COPY requirements.txt .
13
- RUN pip install --upgrade pip
14
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
15
 
16
- # Copy project
17
- COPY . .
18
-
19
- # Expose the port
20
- EXPOSE 8080
21
-
22
- # Run the application
23
- CMD ["python", "app.py"]
 
 
1
  FROM stephengpope/no-code-architects-toolkit:latest
2
 
3
+ # Set non-sensitive environment variables
4
+ ENV MAX_QUEUE_LENGTH=10 \
5
+ GUNICORN_WORKERS=4 \
6
+ GUNICORN_TIMEOUT=300
7
 
8
+ # Load secrets from Hugging Face Secrets using Docker mounts
9
+ RUN --mount=type=secret,id=API_KEY,required=true \
10
+ export API_KEY=$(cat /run/secrets/API_KEY)
11
+ RUN --mount=type=secret,id=S3_ENDPOINT_URL,required=true \
12
+ export S3_ENDPOINT_URL=$(cat /run/secrets/S3_ENDPOINT_URL)
13
+ RUN --mount=type=secret,id=S3_ACCESS_KEY,required=true \
14
+ export S3_ACCESS_KEY=$(cat /run/secrets/S3_ACCESS_KEY)
15
+ RUN --mount=type=secret,id=S3_SECRET_KEY,required=true \
16
+ export S3_SECRET_KEY=$(cat /run/secrets/S3_SECRET_KEY)
17
+ RUN --mount=type=secret,id=S3_BUCKET_NAME,required=true \
18
+ export S3_BUCKET_NAME=$(cat /run/secrets/S3_BUCKET_NAME)
19
+ RUN --mount=type=secret,id=S3_REGION,required=true \
20
+ export S3_REGION=$(cat /run/secrets/S3_REGION)
21
 
22
+ # Re-export as ENV so the Python app can access them
23
+ ENV API_KEY=$API_KEY \
24
+ S3_ENDPOINT_URL=$S3_ENDPOINT_URL \
25
+ S3_ACCESS_KEY=$S3_ACCESS_KEY \
26
+ S3_SECRET_KEY=$S3_SECRET_KEY \
27
+ S3_BUCKET_NAME=$S3_BUCKET_NAME \
28
+ S3_REGION=$S3_REGION
29
 
30
+ EXPOSE 8080