fix: fix docker build for CI

This commit is contained in:
opencode 2026-07-05 23:59:35 +00:00
parent 55244b5027
commit 3ba5e47884
2 changed files with 6 additions and 13 deletions

View File

@ -100,15 +100,15 @@ jobs:
run: | run: |
built=false built=false
if [[ -f docker/Dockerfile.backend ]]; then 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 built=true
fi fi
if [[ -f frontend/Dockerfile ]]; then 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 built=true
fi fi
if [[ -f android/Dockerfile ]]; then 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)" echo "WARNING: Android build failed (williamkyo/android-sdk unavailable, non-blocking)"
built=true built=true
fi fi

View File

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