File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ # ##############################################################################
2+ # 1. BUILD STAGE – uses the official Flutter image (Linux) #
3+ # ##############################################################################
4+ FROM cirrusci/flutter:3.22 as build
5+ WORKDIR /app
6+
7+ # copy source and download dependencies once
8+ COPY pubspec.* ./
9+ RUN flutter pub get
10+
11+ # copy the rest of the project
12+ COPY . .
13+
14+ # build the web release bundle
15+ RUN flutter build web --release
16+
17+ # ##############################################################################
18+ # 2. RUNTIME STAGE – serve with Nginx (tiny image) #
19+ # ##############################################################################
20+ FROM nginx:stable-alpine
21+ # Remove default html
22+ RUN rm -rf /usr/share/nginx/html/*
23+
24+ # Copy Flutter build output to Nginx web root
25+ COPY --from=build /app/build/web /usr/share/nginx/html
26+
27+ # Expose web port
28+ EXPOSE 80
29+
30+ # Start Nginx (Render detects the CMD automatically)
31+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments