FROM fpco/pid1:20.04

ENV LANG C.UTF-8
RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install libpq-dev curl -y && \
    curl -sSL https://get.haskellstack.org/ | sh && \
    unset DEBIAN_FRONTEND
RUN stack update
COPY stack.yaml package.yaml /src/
RUN stack setup --stack-yaml /src/stack.yaml
RUN stack build --only-snapshot --stack-yaml /src/stack.yaml
