29 lines
699 B
Docker
29 lines
699 B
Docker
|
|
FROM ubuntu:20.04 AS build
|
||
|
|
|
||
|
|
RUN apt update
|
||
|
|
RUN apt install -y curl git wget unzip tree
|
||
|
|
RUN apt clean
|
||
|
|
# download Flutter SDK from Flutter Github repo \
|
||
|
|
RUN git clone https://github.com/flutter/flutter.git /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 channel master
|
||
|
|
RUN flutter upgrade
|
||
|
|
RUN flutter config --enable-web
|
||
|
|
|
||
|
|
RUN mkdir /app/
|
||
|
|
COPY . /app/
|
||
|
|
WORKDIR /app/
|
||
|
|
RUN flutter build web && ls -lha
|
||
|
|
|
||
|
|
FROM nginx:alpine AS final
|
||
|
|
RUN apk update && apk add tree
|
||
|
|
RUN tree
|
||
|
|
WORKDIR /usr/share/nginx/html
|
||
|
|
COPY --from=build /app/build/web .
|
||
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||
|
|
RUN tree
|