Load Flutter runtime config from Vault
Build and deploy Flutter Web / build (push) Successful in 6m25s

This commit is contained in:
Ruslan Bakiev
2026-06-24 02:29:46 +07:00
parent c427801621
commit 6552c915a8
10 changed files with 83 additions and 32 deletions
+4 -7
View File
@@ -1,18 +1,12 @@
# syntax=docker/dockerfile:1.7
FROM ghcr.io/cirruslabs/flutter:stable AS build
WORKDIR /app
ARG MAPBOX_STYLE="mapbox/standard"
ARG TELEGRAM_BOT_USERNAME="carfteebot"
ARG BUILD_VERSION="local"
COPY pubspec.* ./
RUN flutter pub get
COPY . .
RUN --mount=type=secret,id=mapbox_access_token,required=true \
MAPBOX_ACCESS_TOKEN="$(cat /run/secrets/mapbox_access_token)" && \
rm -rf build/web && \
RUN rm -rf build/web && \
flutter build web --release --base-href=/ -o build/web \
--dart-define=MAPBOX_ACCESS_TOKEN="$MAPBOX_ACCESS_TOKEN" \
--dart-define=MAPBOX_STYLE="$MAPBOX_STYLE" \
--dart-define=TELEGRAM_BOT_USERNAME="$TELEGRAM_BOT_USERNAME" && \
cp web/index.prod.html build/web/index.html && \
rm -f build/web/index.prod.html && \
@@ -22,6 +16,9 @@ RUN --mount=type=secret,id=mapbox_access_token,required=true \
--version="$BUILD_VERSION"
FROM nginx:1.27-alpine
RUN apk add --no-cache curl jq
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY scripts/40-mapflow-runtime-config.sh /docker-entrypoint.d/40-mapflow-runtime-config.sh
COPY --from=build /app/build/web /usr/share/nginx/html
RUN chmod +x /docker-entrypoint.d/40-mapflow-runtime-config.sh
EXPOSE 80