servant.dockerfile 651 B

123456789101112131415161718192021222324252627
  1. FROM haskell:8.6.5
  2. RUN apt-get update -yqq && apt-get install -yqq xz-utils make
  3. RUN apt-get install -yqq libpq-dev
  4. WORKDIR /app
  5. # Update cabal here
  6. RUN cabal update
  7. # First add only
  8. COPY cabal.project ./
  9. COPY ./servant-tfb/servant-tfb.cabal ./servant-tfb/servant-tfb.cabal
  10. RUN find .
  11. RUN cabal v2-build warp
  12. RUN cabal v2-build wai-app-static
  13. RUN cabal v2-build beam-postgres
  14. RUN cabal v2-build servant-server
  15. ADD ./servant-tfb ./servant-tfb
  16. RUN cabal v2-build all
  17. RUN cp $(find dist-newstyle -name servant-tfb -type f) /app/dist-newstyle/servant-tfb-exe
  18. EXPOSE 7041
  19. CMD /app/dist-newstyle/servant-tfb-exe +RTS -A32m -N$(nproc) -qn2 -M2G -RTS