This repository was archived by the owner on May 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.podman
More file actions
75 lines (64 loc) · 2.27 KB
/
Dockerfile.podman
File metadata and controls
75 lines (64 loc) · 2.27 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Dockerfile optimized for Podman rootless environments using Ubuntu 24.04
FROM ubuntu:24.04
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
ENV PATH="/app/venv/bin:$PATH"
ENV NICEGUI_HOST=0.0.0.0
ENV NICEGUI_PORT=8080
ENV HOME=/app/home
ENV APP_HOME=/app/home
ENV MPLCONFIGDIR=/app/home/.matplotlib
ENV XDG_RUNTIME_DIR=/app/home/.runtime
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
python3.12 \
python3.12-dev \
python3.12-venv \
python3-pip \
libcairo2-dev \
libgirepository-2.0-0 \
libgirepository-2.0-dev \
gir1.2-girepository-2.0 \
pkg-config \
python3-gi \
python3-gi-cairo \
gir1.2-gtk-3.0 \
gobject-introspection \
sqlite3 \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Create symbolic links for python3.12
RUN ln -sf /usr/bin/python3.12 /usr/bin/python3 && \
ln -sf /usr/bin/python3.12 /usr/bin/python
# Set working directory
WORKDIR /app
# Create virtual environment and install Python dependencies
COPY requirements.txt .
RUN python3 -m venv /app/venv && \
/app/venv/bin/pip install --no-cache-dir --upgrade pip setuptools wheel && \
/app/venv/bin/pip install --no-cache-dir -r requirements.txt
# Copy application source code
COPY StudentDataGUI/ ./StudentDataGUI/
COPY __init__.py .
# Ensure local font files are baked into the image at the package path
COPY StudentDataGUI/appHelpers/fonts/ ./StudentDataGUI/appHelpers/fonts/
# Create necessary directories with proper permissions for rootless Podman
RUN mkdir -p /app/home/.cache/fontconfig \
/app/home/.matplotlib \
/app/home/.runtime \
/app/home/StudentDatabase/errorLogs \
&& chmod -R 755 /app \
&& chmod -R 777 /app/home/.matplotlib /app/home/.runtime
# Expose port
EXPOSE 8080
# Health check using Python's built-in urllib instead of external tools
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD /app/venv/bin/python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080')" || exit 1
# Set the entrypoint using the virtual environment
CMD ["/app/venv/bin/python", "-m", "StudentDataGUI"]