Files
turmlibar-calendar/Dockerfile.nocompile
2025-10-30 15:37:01 +01:00

66 lines
1.6 KiB
Docker

# No-compilation Dockerfile for ARM/Raspberry Pi
# Uses Python 3.11 which has better wheel availability
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
TZ=Europe/Berlin
# Install only essential runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone
# Set working directory
WORKDIR /app
# Create a requirements file that avoids compilation
RUN cat > requirements.txt << 'EOF'
# Core dependencies without compilation requirements
fastapi==0.95.2
uvicorn==0.22.0
httpx==0.24.1
icalendar==5.0.7
jinja2==3.1.2
apscheduler==3.10.1
pytz==2023.3
python-multipart==0.0.6
# These versions don't require Rust/C compilation
pydantic==1.10.9
starlette==0.27.0
h11==0.14.0
click==8.1.3
anyio==3.7.0
sniffio==1.3.0
typing-extensions==4.6.3
python-dateutil==2.8.2
MarkupSafe==2.1.3
certifi==2023.5.7
idna==3.4
six==1.16.0
tzlocal==5.0.1
EOF
# Install Python dependencies
# Using --only-binary :all: forces pip to only use pre-built wheels
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --only-binary :all: -r requirements.txt || \
pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY main.py .
COPY Vektor-Logo.svg ./
# Create static directory and copy logo
RUN mkdir -p static && \
cp Vektor-Logo.svg static/logo.svg
# Expose port
EXPOSE 8000
# Run the application
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]