Add multi-stage build to Flutter Dockerfile
Build and Deploy Chitfund / build-backend (push) Successful in 2m20s Details
Build and Deploy Chitfund / build-frontend (push) Failing after 4m13s Details

This commit is contained in:
Antigravity 2026-05-11 18:21:51 -04:00
parent ad10f2450a
commit c35eefd2a9
1 changed files with 9 additions and 11 deletions

View File

@ -1,17 +1,15 @@
# Frontend Dockerfile for Chitfund (Flutter Web)
FROM node:20-slim
FROM ghcr.io/cirruslabs/flutter:3.24.0 AS build
WORKDIR /app
# We serve the build/web directory.
# NOTE: This Dockerfile assumes you have already run 'flutter build web'
# or we will use a multi-stage build if you prefer.
# For simplicity in this home lab, we copy the build output.
COPY package*.json ./
RUN npm install express
COPY . .
RUN flutter pub get
RUN flutter build web --release
FROM node:20-slim
WORKDIR /app
RUN npm init -y && npm install express
COPY --from=build /app/build/web ./build/web
COPY web-server.js .
EXPOSE 8080