-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) 路 1.18 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (25 loc) 路 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Install Operating system and dependencies
FROM ubuntu:26.04 AS builder
ARG BUILD_FLAVOR=production
RUN apt-get update
RUN apt-get install -y curl git wget unzip gdb libstdc++6 libglu1-mesa fonts-droid-fallback python3 yq
RUN apt-get clean
RUN mkdir /flutter_app/
COPY . /flutter_app
WORKDIR /flutter_app/app
# download Flutter SDK from Flutter Github repo
RUN git clone https://github.com/flutter/flutter.git -b $(yq '.environment.flutter' /flutter_app/app/pubspec.yaml -r) /usr/local/flutter
# Set flutter environment path
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"
# Run flutter doctor
RUN flutter doctor
RUN flutter config --enable-web
# Copy files to container and build. The preview image is also published from
# this Dockerfile, so keep its manifest/icons and Dart branding in sync.
RUN if [ "$BUILD_FLAVOR" = "nightly" ] || [ "$BUILD_FLAVOR" = "development" ] || [ "$BUILD_FLAVOR" = "dev" ]; then cp -rf web_nightly/. web/; fi
RUN flutter build web --dart-define=flavor="$BUILD_FLAVOR"
# Nginx Container
FROM nginx:1-alpine
EXPOSE 80
# Copy build/web in container to /app/
COPY --from=builder /flutter_app/app/build/web /usr/share/nginx/html