fix: update Dockerfile to ensure proper user permissions for Flutter build

This commit is contained in:
Nils-Johan Gynther
2026-04-21 22:01:58 +02:00
parent 39384a0e74
commit 7383497cda
+5 -2
View File
@@ -3,10 +3,13 @@ FROM ghcr.io/cirruslabs/flutter:stable AS builder
WORKDIR /app
COPY pubspec.yaml pubspec.lock* ./
RUN useradd -m -u 10001 flutteruser
COPY --chown=flutteruser:flutteruser pubspec.yaml pubspec.lock* ./
USER flutteruser
RUN flutter pub get
COPY . .
COPY --chown=flutteruser:flutteruser . .
# Inject API base URL at build time via --dart-define.
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.