-
-
Notifications
You must be signed in to change notification settings - Fork 64
/
Dockerfile
52 lines (39 loc) · 1.49 KB
/
Dockerfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM debian:12-slim AS builder
USER root
ENV HOME="/root"
ARG flutter_version="stable"
ENV FLUTTER_HOME=${HOME}/sdks/flutter \
FLUTTER_VERSION=$flutter_version
ENV FLUTTER_ROOT=$FLUTTER_HOME
ENV PATH="$FLUTTER_HOME/bin:$FLUTTER_HOME/bin/cache/dart-sdk/bin:$HOME/.pub-cache/bin:${PATH}"
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bash \
curl \
git \
wget \
unzip \
libstdc++6 \
ca-certificates \
xz-utils \
zip \
libglu1-mesa && \
DEBIAN_FRONTEND=noninteractive apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME}
RUN flutter config --no-enable-windows-desktop --no-enable-macos-desktop --no-enable-linux-desktop --no-enable-android --no-enable-ios --enable-web && \
flutter channel stable && \
flutter doctor && \
flutter precache --web --no-ios --no-windows --no-macos --no-linux --no-android && \
chown -R root:root ${FLUTTER_HOME}
WORKDIR /app
COPY . .
RUN dart pub global activate melos && \
melos bootstrap && \
flutter build web --release
FROM nginx:1.27-alpine3.20-slim
COPY --from=builder /app/build/web /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -O /dev/null http://localhost || exit 1
CMD ["nginx", "-g", "daemon off;"]