62 lines
1.8 KiB
Docker
62 lines
1.8 KiB
Docker
# Dockerfile for ARM/Raspberry Pi using pre-built wheels only
|
|
# No compilation required - downloads pre-built binaries
|
|
FROM python:3.13-slim
|
|
|
|
# Set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
TZ=Europe/Berlin \
|
|
PIP_ONLY_BINARY=:all: \
|
|
PIP_PREFER_BINARY=1
|
|
|
|
# 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
|
|
|
|
# Copy requirements file
|
|
COPY requirements.txt ./
|
|
|
|
# Try to install from wheels only first, fall back to allowing some source packages if needed
|
|
# This approach tries pre-built wheels first, which works for most packages
|
|
RUN pip install --no-cache-dir --only-binary :all: --upgrade pip && \
|
|
pip install --no-cache-dir \
|
|
--only-binary numpy,pandas,scipy,scikit-learn,pydantic-core,httptools,uvloop,watchfiles \
|
|
-r requirements.txt || \
|
|
pip install --no-cache-dir \
|
|
--prefer-binary \
|
|
--no-build-isolation \
|
|
fastapi==0.104.1 \
|
|
uvicorn==0.24.0 \
|
|
httpx==0.25.2 \
|
|
icalendar==5.0.11 \
|
|
jinja2==3.1.2 \
|
|
apscheduler==3.10.4 \
|
|
pytz==2023.3 \
|
|
python-multipart==0.0.6 \
|
|
pydantic==2.5.0 \
|
|
starlette==0.27.0 \
|
|
h11==0.14.0 \
|
|
click==8.1.7 \
|
|
anyio==4.1.0 \
|
|
sniffio==1.3.0 \
|
|
typing-extensions==4.8.0
|
|
|
|
# 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 with basic uvicorn (no uvloop)
|
|
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--loop", "asyncio"] |