I had tried building a PoC Happstack executable running in Google App Engine using this Dockerfile:
FROM ubuntu:14.04
ENV APP_ROOT=/usr/share/app
RUN apt-get update && apt-get install curl -y && curl -sSL https://get.haskellstack.org/ | sh
COPY . ${APP_ROOT}/
WORKDIR ${APP_ROOT}/
RUN stack setup
RUN stack build
EXPOSE 8000
ENTRYPOINT ["stack","exec","app-exe"]
This works and I was able to deploy, but the resulting image seems huge.
I think the image is about 450MB following the stack
installation, about 1.8GB following stack setup
, and about 3GB following stack build
.
I think hundreds of MB seems reasonable, even up to a GB. Is there a different approach I should be taking, perhaps extracting the resulting executable to another image somehow to eliminate everything unnecessary at runtime?