-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 715 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use Python 3.10 slim image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the Flask application code to /app
COPY app /app
# Create necessary directories
RUN mkdir -p /app/staticFiles/uploads
# Set environment variables
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
# Expose port
EXPOSE $PORT
# Set working directory to the Flask app
WORKDIR /app
# Run the application
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:$PORT app:app"]