-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.05 KB
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
# Use an official lightweight Python base image
FROM python:3.14-slim@sha256:3955a7dd66ccf92b68d0232f7f86d892eaf75255511dc7e98961bdc990dc6c9b as base
# Set working directory
WORKDIR /app
# Install essential tools and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libseccomp-dev \
vim \
containerd \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt /app/
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY common /app/common
COPY lib /app/lib
COPY web /app/web
COPY agent /app/agent
COPY ./*.py /app/
# Set Flask environment variables
ENV FLASK_APP=web.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_ENV=development
ENV PYTHONPATH=/app:$PYTHONPATH
# Expose Flask's port
EXPOSE 5000
# Final cleanup for a smaller image
RUN apt-get purge -y gcc && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
# Command to run the Flask app
CMD ["flask", "run", "--debug"]