diff options
| author | diogo464 <[email protected]> | 2025-05-28 20:46:55 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-05-28 20:46:55 +0100 |
| commit | 05f7444ecd2e3405b0e595042166ec5f8a3395ab (patch) | |
| tree | 2b28bca5dab0f2ec79c41893732b5d6866725f56 /Containerfile | |
init
Diffstat (limited to 'Containerfile')
| -rw-r--r-- | Containerfile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..c8ff201 --- /dev/null +++ b/Containerfile | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | FROM python:3.9-slim | ||
| 2 | |||
| 3 | # Set working directory | ||
| 4 | WORKDIR /app | ||
| 5 | |||
| 6 | # Install system dependencies | ||
| 7 | RUN apt-get update && apt-get install -y \ | ||
| 8 | git \ | ||
| 9 | && rm -rf /var/lib/apt/lists/* | ||
| 10 | |||
| 11 | # Copy requirements and install Python dependencies | ||
| 12 | COPY requirements.txt . | ||
| 13 | RUN pip install --no-cache-dir -r requirements.txt | ||
| 14 | |||
| 15 | # === BONSAI SETUP SECTION === | ||
| 16 | WORKDIR /usr/src/bonsai | ||
| 17 | RUN git clone https://codelab.fct.unl.pt/di/computer-systems/bonsai . && \ | ||
| 18 | pip install --no-cache-dir 'torch~=2.0.1' && \ | ||
| 19 | pip install --no-cache-dir -r requirements.txt | ||
| 20 | # === END BONSAI SETUP SECTION === | ||
| 21 | |||
| 22 | # Copy application files | ||
| 23 | COPY app.py . | ||
| 24 | COPY index.html . | ||
| 25 | COPY script.js . | ||
| 26 | COPY logo.png . | ||
| 27 | |||
| 28 | # Expose the port | ||
| 29 | EXPOSE 5000 | ||
| 30 | |||
| 31 | # Set environment variables | ||
| 32 | ENV FLASK_APP=app.py | ||
| 33 | ENV FLASK_ENV=production | ||
| 34 | ENV BONSAI_TEST_MODE=false | ||
| 35 | |||
| 36 | # Run the application | ||
| 37 | CMD ["python", "app.py"] \ No newline at end of file | ||
