Last active
January 27, 2023 15:22
-
-
Save tfausak/1aab1287aa78c99ed55fd14d7cbcef25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stable-slim as build | |
RUN apt-get update && apt-get install --assume-yes \ | |
gcc \ | |
libgmp-dev \ | |
make \ | |
wget \ | |
xz-utils \ | |
zlib1g-dev | |
WORKDIR /root/stack | |
RUN wget https://github.com/commercialhaskell/stack/releases/download/v1.5.1/stack-1.5.1-linux-x86_64-static.tar.gz | |
RUN tar --extract --file stack-*-linux-x86_64-static.tar.gz | |
RUN cp stack-*-linux-x86_64-static/stack /usr/local/bin | |
WORKDIR /root/project | |
COPY stack.yaml . | |
RUN stack setup | |
COPY package.yaml . | |
RUN stack build --only-dependencies | |
COPY . . | |
RUN stack install --ghc-options -optl-static | |
FROM scratch | |
COPY --from=build /root/.local/bin/example / | |
ENV PORT 80 | |
EXPOSE $PORT | |
CMD ["/example"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Text as Text | |
import qualified Data.Text.IO as Text | |
main :: IO () | |
main = Text.putStrLn (Text.pack "Hello, world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: example | |
version: 1.0.0 | |
executables: | |
example: | |
main: example.hs | |
dependencies: [base, text] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resolver: lts-9.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment