Files
workavia-mail-front/Dockerfile
T
dab246 9a237ec86e Upgrade flutter to v3.10.6 for Dockerfile
(cherry picked from commit b17c3a19c219292233e5173f25a13706afaf2beb)
2023-08-18 21:29:50 +07:00

24 lines
730 B
Docker

# Stage 1 - Install dependencies and build the app
# This matches the flutter version on our CI/CD pipeline on Github
FROM ghcr.io/cirruslabs/flutter:3.10.6 AS build-env
# Set directory to Copy App
WORKDIR /app
COPY . .
# Precompile tmail flutter
RUN bash prebuild.sh && flutter build web --release
# Stage 2 - Create the run-time image
FROM nginx:mainline
RUN chmod -R 755 /usr/share/nginx/html && apt install -y gzip
COPY --from=build-env /app/server/nginx.conf /etc/nginx
COPY --from=build-env /app/build/web /usr/share/nginx/html
# Record the exposed port
EXPOSE 80
# Before stating NGinx, re-zip all the content to ensure customizations are propagated
CMD gzip -k -r -f /usr/share/nginx/html/ && nginx -g 'daemon off;'