Skip to content

Commit f98ea8c

Browse files
committed
added dockerfile
1 parent 592e579 commit f98ea8c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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;"]

0 commit comments

Comments
 (0)