Add multi-stage build to Flutter Dockerfile
This commit is contained in:
parent
ad10f2450a
commit
c35eefd2a9
|
|
@ -1,17 +1,15 @@
|
||||||
# Frontend Dockerfile for Chitfund (Flutter Web)
|
# Frontend Dockerfile for Chitfund (Flutter Web)
|
||||||
FROM node:20-slim
|
FROM ghcr.io/cirruslabs/flutter:3.24.0 AS build
|
||||||
|
|
||||||
WORKDIR /app
|
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 . .
|
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
|
EXPOSE 8080
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue