fix: build cache, image size

This commit is contained in:
orion 2023-11-27 22:02:54 -06:00
parent 8af6098455
commit d979f42302
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -1,26 +1,33 @@
FROM git.orionkindel.com/tpl/asdf:bookworm
RUN git clone https://github.com/purescript/pursuit.git
RUN git clone https://github.com/purescript/pursuit-backups.git --depth 1
WORKDIR pursuit
RUN mkdir -p data/verified
RUN cp -R ../pursuit-backups/* data/verified
RUN apt-get update && apt-get install -y locales && sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen
RUN echo 'LANG="en_US.UTF-8"' > /etc/default/locale \
RUN apt-get update
RUN apt-get install -y wget libgmp-dev locales
RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& echo 'LANG="en_US.UTF-8"' > /etc/default/locale \
&& echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc \
&& echo "export LANG=en_US.UTF-8" >> ~/.bashrc \
&& echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc
RUN locale
RUN apt-get install -y wget libgmp-dev
RUN git clone https://github.com/purescript/pursuit.git --depth 1
RUN git clone https://github.com/purescript/pursuit-backups.git --depth 1
VOLUME pursuit/data
RUN mkdir -p pursuit/data/verified
RUN mv pursuit-backups/* pursuit/data/verified
RUN rm -r pursuit-backups
RUN curl --silent \
--show-error \
--output /tmp/stack.tar.gz \
--location 'https://github.com/commercialhaskell/stack/releases/download/v2.5.1/stack-2.5.1-linux-x86_64.tar.gz' \
&& tar -xzf /tmp/stack.tar.gz \
&& cp stack-2.5.1-linux-x86_64/stack /usr/bin
&& cp stack-2.5.1-linux-x86_64/stack /usr/bin
WORKDIR pursuit
COPY stack.yaml .
RUN stack --no-terminal build --flag pursuit:-dev
RUN --mount=type=cache,target=/root/.stack \
--mount=type=cache,target=/pursuit/.stack-work \
stack --no-terminal build --flag pursuit:-dev
CMD ["/bin/bash", "-lc", "stack exec pursuit"]