Files
tiptoi-sync/Dockerfile.android
T
arnef 8ef7b9ce8c
CI / Type-Check (push) Successful in 16s
CI / Build Android APK (push) Successful in 5m20s
Flatten repo: move client/ contents to repo root
The project is no longer a monorepo/workspace - there is only a single
app package. Remove the redundant client/ nesting: all source, the
Capacitor Android project, config files and package.json/tsconfig now
live directly at the repo root.

- Merge client/package.json into root package.json (drop the
  workspaces field and the now-unnecessary bun --cwd client wrappers).
- Merge client/bun.lock (the actual dependency lockfile) into the
  root, replacing the stale workspace-only root lockfile.
- Move src/, public/, android/, index.html, vite.config.ts,
  capacitor.config.ts, tsconfig.{app,node}.json to the repo root.
- Update Dockerfile.android to build from the repo root instead of
  cd'ing into client/.
- Update .github/workflows/ci.yml type-check step to run bun run build
  directly instead of bun --cwd client run build.
- Update README.md and .github/copilot-instructions.md to drop
  references to the client/ subdirectory.
- Drop the stale server/downloads/ entry from .gitignore (leftover
  from an old server-based architecture that no longer exists).
2026-08-13 21:52:32 +02:00

60 lines
2.1 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ── Stage 1: Tools (wird gecacht nur bei SDK-Änderungen neu gebaut) ────────
FROM eclipse-temurin:21-jdk-jammy AS tools
RUN apt-get update && apt-get install -y --no-install-recommends \
curl unzip wget ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Bun
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
# Symlink damit Tools mit #!/usr/bin/env node funktionieren
RUN ln -s /root/.bun/bin/bun /usr/local/bin/node
# Android SDK
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"
RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \
-O /tmp/tools.zip && \
unzip -q /tmp/tools.zip -d $ANDROID_HOME/cmdline-tools && \
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest && \
rm /tmp/tools.zip
RUN yes | sdkmanager --licenses > /dev/null 2>&1 && \
sdkmanager \
"platforms;android-35" \
"build-tools;35.0.0" \
"platform-tools"
# ── Stage 2: Build ────────────────────────────────────────────────────────────
FROM tools AS builder
WORKDIR /app
# Abhängigkeiten cachen
COPY package.json bun.lock* ./
RUN bun install
COPY . .
# 1. Web-App bauen (ohne PWA Service Worker für Capacitor)
RUN CAPACITOR=1 bun run build
# 2. Web-Assets in das Android-Projekt synchronisieren
# (android/ ist im Repo eingecheckt kein cap add nötig)
RUN CI=true ./node_modules/.bin/cap sync android
# 3. APK bauen
RUN cd android && \
chmod +x gradlew && \
GRADLE_OPTS="-Xmx3g -XX:MaxMetaspaceSize=512m" \
./gradlew assembleDebug --no-daemon
# ── Stage 3: Nur die APK (für --output) ──────────────────────────────────────
FROM scratch
COPY --from=builder \
/app/android/app/build/outputs/apk/debug/app-debug.apk \
/tiptoi-sync.apk