fix: fix docker build for CI
This commit is contained in:
parent
55244b5027
commit
3ba5e47884
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user