Skip to content

Commit 5a0455e

Browse files
committed
minor changes
1 parent f98ea8c commit 5a0455e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
###############################################################################
2-
# 1. BUILD STAGE – uses the official Flutter image (Linux) #
2+
# 1 BUILD STAGE #
33
###############################################################################
4-
FROM cirrusci/flutter:3.22 as build
4+
# Use the official Flutter image with the latest stable SDK (3.22 at July 2025)
5+
FROM cirrusci/flutter:3.22 AS build
6+
7+
# Set working directory inside the container
58
WORKDIR /app
69

7-
# copy source and download dependencies once
10+
# --- Caching trick: copy pubspec first, fetch deps, then rest of the code ----
811
COPY pubspec.* ./
912
RUN flutter pub get
1013

11-
# copy the rest of the project
14+
# Copy the rest of the sources and build the web release bundle
1215
COPY . .
13-
14-
# build the web release bundle
15-
RUN flutter build web --release
16+
RUN flutter build web --release # output → build/web
1617

1718
###############################################################################
18-
# 2. RUNTIME STAGE – serve with Nginx (tiny image) #
19+
# 2 RUNTIME STAGE (static site) #
1920
###############################################################################
2021
FROM nginx:stable-alpine
21-
# Remove default html
22-
RUN rm -rf /usr/share/nginx/html/*
2322

24-
# Copy Flutter build output to Nginx web root
23+
# Remove default Nginx html & copy Flutter build
24+
RUN rm -rf /usr/share/nginx/html/*
2525
COPY --from=build /app/build/web /usr/share/nginx/html
2626

2727
# Expose web port
2828
EXPOSE 80
2929

30-
# Start Nginx (Render detects the CMD automatically)
30+
# Start Nginx in the foreground (Render auto-detects this)
3131
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)