Merge pull request 'fix: fix docker build for CI' (#50) from ci-fix into main
Some checks are pending
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
CI / docker-build (push) Waiting to run
CI / security (push) Waiting to run
CI / build-result (push) Blocked by required conditions

Reviewed-on: https://git.home.ms/jarianc/lofi-app/pulls/50
This commit is contained in:
jarianc 2026-07-05 19:13:28 -05:00
commit ae822ea505
2 changed files with 6 additions and 13 deletions

View File

@ -100,15 +100,15 @@ jobs:
run: |
built=false
if [[ -f docker/Dockerfile.backend ]]; then
docker build -t $GITHUB_REPOSITORY-backend:test -f docker/Dockerfile.backend .
docker build -t $(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')-backend:test -f docker/Dockerfile.backend .
built=true
fi
if [[ -f frontend/Dockerfile ]]; then
docker build -t $GITHUB_REPOSITORY-frontend:test -f frontend/Dockerfile .
docker build -t $(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')-frontend:test -f frontend/Dockerfile .
built=true
fi
if [[ -f android/Dockerfile ]]; then
docker build -t $GITHUB_REPOSITORY-android:test -f android/Dockerfile android/ || \
docker build -t $(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')-android:test -f android/Dockerfile android/ || \
echo "WARNING: Android build failed (williamkyo/android-sdk unavailable, non-blocking)"
built=true
fi

View File

@ -1,14 +1,8 @@
FROM python:3.12-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends curl unzip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY pyproject.toml uv.lock ./
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -LsSf https://astral.sh/uv/0.5.25/install.sh | sh \
&& . "$HOME/.local/bin/env" \
&& uv sync --frozen
COPY pyproject.toml ./
RUN pip install --no-cache-dir -e .
SHELL ["/bin/sh", "-c"]
@ -44,8 +38,7 @@ WORKDIR /app
COPY src/ ./src/
ENV PLAYWRIGHT_BROWSERS_PATH=/app/.cache/ms-playwright
RUN --mount=from=builder,source=/build/.venv/bin,target=/build/.venv/bin \
/build/.venv/bin/python -m playwright install chromium 2>/dev/null || true
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
RUN chown -R appuser:appuser /app
RUN chown -R appuser:appuser /build