-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 882 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 882 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
# Use a lightweight Python base image
FROM python:3.10-slim
# Prevent Python from writing pyc files to disc
ENV PYTHONDONTWRITEBYTECODE=1
# Prevent Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1
# Set the working directory inside the container
WORKDIR /app
# Install system-level solvers (GLPK and CBC)
RUN apt-get update && apt-get install -y \
glpk-utils \
coinor-cbc \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file first (to leverage caching)
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
# This assumes 'WebAPP', 'Classes', and 'Routes' are in the same folder as Dockerfile
COPY . .
RUN chmod -R +x /app/WebAPP/SOLVERs
# Expose the port the app runs on
EXPOSE 5002
# Define the command to run the application
CMD ["python", "API/app.py"]