I dont know what im doing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# Optimized Dockerfile for Raspberry Pi Zero (ARMv6)
|
||||
# Minimal memory footprint and no compilation required
|
||||
# Using Python 3.11 for compatibility with Pydantic v1
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set environment variables
|
||||
@@ -19,17 +20,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements file first for better layer caching
|
||||
COPY requirements-pizero.txt .
|
||||
|
||||
# Install Python dependencies one by one for better memory management on Pi Zero
|
||||
# Using older stable versions that are known to work on ARMv6
|
||||
RUN pip install --no-cache-dir fastapi==0.95.2
|
||||
RUN pip install --no-cache-dir pydantic==1.10.9
|
||||
RUN pip install --no-cache-dir uvicorn==0.22.0
|
||||
RUN pip install --no-cache-dir httpx==0.24.1
|
||||
RUN pip install --no-cache-dir icalendar==5.0.7
|
||||
RUN pip install --no-cache-dir jinja2==3.1.2
|
||||
RUN pip install --no-cache-dir apscheduler==3.10.1
|
||||
RUN pip install --no-cache-dir pytz==2023.3
|
||||
RUN pip install --no-cache-dir python-multipart==0.0.6
|
||||
# Using versions that are compatible with Python 3.11 and don't require compilation
|
||||
RUN pip install --no-cache-dir --no-compile fastapi==0.95.2
|
||||
RUN pip install --no-cache-dir --no-compile pydantic==1.10.9
|
||||
RUN pip install --no-cache-dir --no-compile uvicorn==0.22.0
|
||||
RUN pip install --no-cache-dir --no-compile httpx==0.24.1
|
||||
RUN pip install --no-cache-dir --no-compile icalendar==5.0.7
|
||||
RUN pip install --no-cache-dir --no-compile jinja2==3.1.2
|
||||
RUN pip install --no-cache-dir --no-compile apscheduler==3.10.1
|
||||
RUN pip install --no-cache-dir --no-compile pytz==2023.3
|
||||
RUN pip install --no-cache-dir --no-compile python-multipart==0.0.6
|
||||
|
||||
# Copy application files
|
||||
COPY main.py .
|
||||
@@ -43,4 +47,5 @@ RUN mkdir -p static && \
|
||||
EXPOSE 8000
|
||||
|
||||
# Run with limited workers and basic asyncio loop for Pi Zero
|
||||
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--loop", "asyncio"]
|
||||
# Using explicit python command to ensure correct Python version
|
||||
CMD ["python3.11", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--loop", "asyncio"]
|
||||
Reference in New Issue
Block a user