diff --git a/Dockerfile b/Dockerfile index ebde756..7d1b7bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,6 +65,17 @@ COPY build-worker/package.json /worker/package.json COPY build-worker/template /worker/template RUN cd /worker && npm install +# ── Pre-warm Gradle cache (saves ~10 min on first user build) ── +# Run a dummy build with the template to download all Gradle/Maven deps +RUN mkdir -p /tmp/warmup && cp -r /worker/template/* /tmp/warmup/ && \ + cd /tmp/warmup && npm install --legacy-peer-deps && \ + npx expo prebuild --platform android --no-install && \ + cd /tmp/warmup/android && chmod +x gradlew && \ + ./gradlew assembleRelease --no-daemon \ + -Dorg.gradle.jvmargs='-Xmx2g' || true && \ + # Keep the Gradle cache, delete the project + rm -rf /tmp/warmup + # ── Supervisor config to run both processes ── RUN mkdir -p /var/log/supervisor COPY <<'EOF' /etc/supervisor/conf.d/app.conf