forked from Babban33/Mushroom-Classification
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOCKERFILE
More file actions
32 lines (24 loc) · 731 Bytes
/
DOCKERFILE
File metadata and controls
32 lines (24 loc) · 731 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
# Base image
FROM python:3.9-slim
# Set the working directory
WORKDIR /app
# Copy all the files to the container
COPY . /app/
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Create and activate the virtual environment
RUN python -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN echo "source /venv/bin/activate" >> ~/.bashrc
# Upgrade pip and install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Expose the Flask app's port
EXPOSE 5000
# Set the environment variable for Flask
ENV FLASK_APP=app.py
# Run the Flask application
CMD python app.py