Merge pull request #7 from gamosoft/features/multi-platform
Features/multi platform
This commit is contained in:
commit
b652cff5eb
|
|
@ -58,7 +58,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64 #,linux/arm64,linux/arm/v7
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
|
||||||
32
Dockerfile
32
Dockerfile
|
|
@ -1,34 +1,24 @@
|
||||||
# Build stage - compile dependencies
|
# Stage 1: Install dependencies
|
||||||
FROM python:3.11-slim AS builder
|
FROM python:3.11-slim AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install build dependencies (only in this stage)
|
# Install Python packages
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
gcc \
|
|
||||||
libssl-dev \
|
|
||||||
libffi-dev \
|
|
||||||
python3-dev \
|
|
||||||
cargo \
|
|
||||||
rustc \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install Python dependencies
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir --upgrade pip && \
|
RUN pip install --no-cache-dir --upgrade pip && \
|
||||||
pip install --no-cache-dir --prefix=/install -r requirements.txt
|
pip install --no-cache-dir --prefix=/install -r requirements.txt && \
|
||||||
|
# Clean up unnecessary files to reduce image size
|
||||||
|
find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
|
||||||
|
find /install -type f -name "*.pyc" -delete && \
|
||||||
|
find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \
|
||||||
|
find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true
|
||||||
|
|
||||||
# Final stage - minimal runtime image
|
# Stage 2: Final minimal image
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install only runtime dependencies (not build tools!)
|
# Copy only installed packages (no pip cache, no build artifacts)
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
libssl3 \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Copy installed Python packages from builder
|
|
||||||
COPY --from=builder /install /usr/local
|
COPY --from=builder /install /usr/local
|
||||||
|
|
||||||
# Copy application files
|
# Copy application files
|
||||||
|
|
@ -45,7 +35,7 @@ RUN mkdir -p data/notes data/search_index
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 \
|
||||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,6 @@ NoteDiscovery is a **lightweight, self-hosted note-taking application** that put
|
||||||
Use the pre-built image directly from GHCR - no building required!
|
Use the pre-built image directly from GHCR - no building required!
|
||||||
|
|
||||||
> **💡 Tip**: Always use `ghcr.io/gamosoft/notediscovery:latest` to get the newest features and fixes. Images are automatically built when PRs are merged to main.
|
> **💡 Tip**: Always use `ghcr.io/gamosoft/notediscovery:latest` to get the newest features and fixes. Images are automatically built when PRs are merged to main.
|
||||||
>
|
|
||||||
> **🖥️ Multi-Architecture Support**: Images are built for `x86_64`, `ARM64` (Raspberry Pi 3/4/5), and `ARM v7` (older Raspberry Pi models). Docker will automatically pull the correct version for your device.
|
|
||||||
|
|
||||||
> **📁 Important - Volume Mapping**: The container needs local folders/files to work:
|
> **📁 Important - Volume Mapping**: The container needs local folders/files to work:
|
||||||
> - **Required**: `data` folder (your notes will be stored here)
|
> - **Required**: `data` folder (your notes will be stored here)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue