FROM ghcr.io/cirruslabs/flutter:stable AS build WORKDIR /workspace/app RUN flutter config --enable-web RUN flutter create --platforms=web --project-name flutter_ecommerce_portal --org com.example.portal /workspace/app COPY pubspec.yaml /workspace/app/pubspec.yaml RUN flutter pub get COPY lib /workspace/app/lib COPY assets /workspace/app/assets RUN flutter build web --release FROM nginx:1.27-alpine AS runtime COPY --from=build /workspace/app/build/web /usr/share/nginx/html COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf COPY docker/entrypoint/30-generate-runtime-config.sh /docker-entrypoint.d/30-generate-runtime-config.sh COPY assets/config/runtime_config.template.json /opt/runtime_config.template.json RUN chmod +x /docker-entrypoint.d/30-generate-runtime-config.sh EXPOSE 80