-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerFile
More file actions
44 lines (34 loc) · 932 Bytes
/
Copy pathDockerFile
File metadata and controls
44 lines (34 loc) · 932 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
35
36
37
38
39
40
41
42
43
44
# Wine Quality Prediction Docker Image
# 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++ \
python3-dev \
git \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip first
RUN pip install --no-cache-dir --upgrade pip
# Copy only requirements.txt first (for better caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create necessary directories
RUN mkdir -p artifacts/data_ingestion \
artifacts/data_validation \
artifacts/data_transformation \
artifacts/model_trainer \
artifacts/model_evaluation
# Expose port for Flask
EXPOSE 8080
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=app.py
ENV PORT=8080
# Run the application
CMD ["python", "app.py"]