LifeMate — Personal, Family & Learning Companion

feat/weekly-planner-android
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
text 44 lines 2.07 KB
Raw
1 # SDK pinned to the exact official Flutter revision used by CI.
2 # Build dependencies may need developer-side network access;
3 # the shipped client loads its resources from the deployment origin.
4 FROM node:22-bookworm-slim AS node-tools
5 FROM ubuntu:24.04 AS build
6 ARG FLUTTER_REVISION=5fc346839b5d0eef006ed8404392afb4dfae428d
7 ARG FLUTTER_VERSION=3.47.6
8 ENV PATH="/opt/flutter/bin:${PATH}"
9 RUN apt-get update && apt-get install -y --no-install-recommends \
10 ca-certificates curl git unzip xz-utils libglu1-mesa \
11 && rm -rf /var/lib/apt/lists/*
12 RUN --mount=type=secret,id=build_ca \
13 if [ -s /run/secrets/build_ca ]; then \
14 cp /run/secrets/build_ca /usr/local/share/ca-certificates/build-proxy.crt \
15 && update-ca-certificates; fi \
16 && git init /opt/flutter \
17 && git -C /opt/flutter remote add origin https://github.com/flutter/flutter.git \
18 && git -C /opt/flutter fetch --depth 1 origin "$FLUTTER_REVISION" \
19 && git -C /opt/flutter checkout --detach FETCH_HEAD \
20 && git -C /opt/flutter fetch --depth 1 origin "refs/tags/$FLUTTER_VERSION:refs/tags/$FLUTTER_VERSION" \
21 && test "$(git -C /opt/flutter rev-parse "refs/tags/$FLUTTER_VERSION")" = "$FLUTTER_REVISION" \
22 && rm -f /opt/flutter/bin/cache/flutter.version.json \
23 && flutter config --enable-web --no-analytics \
24 && flutter precache --web
25 WORKDIR /src
26 COPY pubspec.yaml pubspec.lock ./
27 RUN flutter pub get
28 COPY . .
29 RUN flutter build web --release --no-web-resources-cdn --pwa-strategy=none
30
31 # Process only the small shipped artifact in a separate Node stage. Keeping
32 # Node out of the Flutter stage also avoids another SDK-sized builder snapshot.
33 FROM node-tools AS web-artifact
34 WORKDIR /artifact
35 COPY --from=build /src/build/web ./web
36 COPY tool/self_host_web.mjs ./self_host_web.mjs
37 RUN node self_host_web.mjs web
38
39 FROM nginx:1.28-alpine
40 COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
41 COPY deploy/security-headers.inc /etc/nginx/security-headers.inc
42 COPY --from=web-artifact --chown=nginx:nginx /artifact/web /usr/share/nginx/html
43 RUN mkdir -p /usr/share/nginx/html/downloads /etc/nginx/tls
44 EXPOSE 443