Files
workavia-mail-front/Dockerfile
T
2025-07-31 16:38:04 +07:00

30 lines
963 B
Docker

ARG FLUTTER_VERSION=3.27.4
# Stage 1 - Install dependencies and build the app
# This matches the flutter version on our CI/CD pipeline on Github
# FROM --platform=amd64 ghcr.io/cirruslabs/flutter:${FLUTTER_VERSION} AS build-env
FROM --platform=amd64 ghcr.io/instrumentisto/flutter:${FLUTTER_VERSION} AS build-env
# TODO: Revert back to cirruslabs when upgrade Flutter pass 3.27.4, as this tag is missing for cirruslabs
# Set directory to Copy App
WORKDIR /app
COPY . .
# Precompile tmail flutter
RUN ./scripts/prebuild.sh
# Build flutter for web
RUN flutter build web --release
# Stage 2 - Create the run-time image
FROM nginx:alpine
RUN apk add 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
RUN gzip -k -r -f /usr/share/nginx/html/
CMD nginx -g 'daemon off;'