Automazione build con Dockerfile
This commit is contained in:
parent
e2d4f66ee9
commit
1ffd39d441
|
@ -0,0 +1,5 @@
|
|||
_site
|
||||
_cache
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
|
18
Dockerfile
18
Dockerfile
|
@ -5,13 +5,27 @@ COPY ./Site.cabal /opt/site/Site.cabal
|
|||
RUN cabal build --only-dependencies -j
|
||||
COPY ./site.hs /opt/site/site.hs
|
||||
RUN cabal install
|
||||
RUN mv $(readlink -f /root/.cabal/bin/site) /opt/site/site
|
||||
RUN mv $(readlink -f /root/.local/bin/site) /opt/site/site
|
||||
|
||||
FROM debian:bookworm
|
||||
FROM debian:bookworm AS site-env
|
||||
WORKDIR /opt/site
|
||||
RUN apt update && apt install -y texlive texlive-luatex texlive-latex-extra texlive-lang-italian latexmk curl git
|
||||
RUN mkdir -p /usr/share/fonts/opentype/alegreya-sans && \
|
||||
curl -fsSL -o - https://github.com/huertatipografica/Alegreya-Sans/archive/refs/tags/v2.008.tar.gz | \
|
||||
tar --strip-components 3 -C /usr/share/fonts/opentype/alegreya-sans -xzf - Alegreya-Sans-2.008/fonts/otf/
|
||||
COPY --from=haskell-builder /opt/site/site /opt/site/site
|
||||
RUN curl -fsSL https://github.com/sass/dart-sass/releases/download/1.71.0/dart-sass-1.71.0-linux-x64.tar.gz | tar xz -C /opt
|
||||
ENV PATH="${PATH}:/opt/dart-sass"
|
||||
|
||||
ENV LANG=C.utf8
|
||||
ENV LANGUAGE=C.utf8
|
||||
ENV LC_ALL=C.utf8
|
||||
ENTRYPOINT ["/opt/site/site"]
|
||||
|
||||
FROM site-env AS site-builder
|
||||
WORKDIR /opt/site
|
||||
COPY . /opt/site
|
||||
RUN ["/opt/site/site", "build"]
|
||||
|
||||
FROM scratch AS site
|
||||
COPY --from=site-builder /opt/site/_site/ /
|
||||
|
|
Loading…
Reference in New Issue