blob: 6007249cc51f43f47540dd4bc3f38504e7d922d1 (
plain)
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
|
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
build-essential \
g++ \
gcc \
make \
&& rm -rf /var/lib/apt/lists/*
# === BONSAI SETUP SECTION ===
WORKDIR /usr/src/bonsai
RUN git clone https://codelab.fct.unl.pt/di/computer-systems/bonsai . && \
pip install --no-cache-dir 'torch~=2.0.1' && \
pip install --no-cache-dir -r requirements.txt
# === END BONSAI SETUP SECTION ===
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY app.py .
COPY index.html .
COPY script.js .
COPY logo.png .
COPY favicon.ico .
# Expose the port
EXPOSE 5000
# Set environment variables
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
ENV BONSAI_TEST_MODE=false
# Run the application
CMD ["python", "app.py"]
|