Files
recipe-app/flutter/Dockerfile
T
Nils-Johan Gynther aefc8804ad Add unit tests for ProfileRepository and implement new shaders
- Created `NativeAssetsManifest.json` and added font and shader assets for unit tests.
- Implemented `ink_sparkle.frag` and `stretch_effect.frag` shaders for visual effects.
- Developed unit tests for `ProfileRepository` to validate API interactions for fetching and updating user profiles.
- Utilized Mockito for mocking API client responses in tests.
2026-04-23 17:50:48 +02:00

34 lines
823 B
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 Build Flutter web
FROM ghcr.io/cirruslabs/flutter:stable AS builder
WORKDIR /app
COPY pubspec.yaml pubspec.lock* ./
RUN flutter pub get
COPY . .
# Generate localizations (ARB -> Dart) before the main build.
RUN flutter gen-l10n
# Run tests
RUN flutter test
# Inject API base URL at build time via --dart-define.
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.
ARG API_BASE_URL=/api
RUN flutter build web --release \
--dart-define=API_BASE_URL=${API_BASE_URL}
# Stage 2 Serve with Caddy
FROM caddy:alpine AS runner
ARG PORT=5000
ENV PORT=${PORT}
COPY --from=builder /app/build/web /usr/share/caddy
COPY Caddyfile /etc/caddy/Caddyfile
EXPOSE ${PORT}
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]