Skip to content

Commit b652cff

Browse files
authored
Merge pull request #7 from gamosoft/features/multi-platform
Features/multi platform
2 parents abaff62 + 98bfc95 commit b652cff

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
uses: docker/build-push-action@v5
5959
with:
6060
context: .
61-
platforms: linux/amd64,linux/arm64,linux/arm/v7
61+
platforms: linux/amd64 #,linux/arm64,linux/arm/v7
6262
push: true
6363
tags: ${{ steps.meta.outputs.tags }}
6464
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
1-
# Build stage - compile dependencies
1+
# Stage 1: Install dependencies
22
FROM python:3.11-slim AS builder
33

44
WORKDIR /app
55

6-
# Install build dependencies (only in this stage)
7-
RUN apt-get update && apt-get install -y --no-install-recommends \
8-
gcc \
9-
libssl-dev \
10-
libffi-dev \
11-
python3-dev \
12-
cargo \
13-
rustc \
14-
&& rm -rf /var/lib/apt/lists/*
15-
16-
# Install Python dependencies
6+
# Install Python packages
177
COPY requirements.txt .
188
RUN pip install --no-cache-dir --upgrade pip && \
19-
pip install --no-cache-dir --prefix=/install -r requirements.txt
20-
21-
# Final stage - minimal runtime image
9+
pip install --no-cache-dir --prefix=/install -r requirements.txt && \
10+
# Clean up unnecessary files to reduce image size
11+
find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
12+
find /install -type f -name "*.pyc" -delete && \
13+
find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \
14+
find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true
15+
16+
# Stage 2: Final minimal image
2217
FROM python:3.11-slim
2318

2419
WORKDIR /app
2520

26-
# Install only runtime dependencies (not build tools!)
27-
RUN apt-get update && apt-get install -y --no-install-recommends \
28-
libssl3 \
29-
&& rm -rf /var/lib/apt/lists/*
30-
31-
# Copy installed Python packages from builder
21+
# Copy only installed packages (no pip cache, no build artifacts)
3222
COPY --from=builder /install /usr/local
3323

3424
# Copy application files
@@ -45,7 +35,7 @@ RUN mkdir -p data/notes data/search_index
4535
EXPOSE 8000
4636

4737
# Health check
48-
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
38+
HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 \
4939
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
5040

5141
# Run the application

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ NoteDiscovery is a **lightweight, self-hosted note-taking application** that put
4646
Use the pre-built image directly from GHCR - no building required!
4747

4848
> **💡 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.
49-
>
50-
> **🖥️ 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.
5149
5250
> **📁 Important - Volume Mapping**: The container needs local folders/files to work:
5351
> - **Required**: `data` folder (your notes will be stored here)

0 commit comments

Comments
 (0)