diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e24c5fb576dec6100aca3e9947a8b93e02e8cc5..9c0688468bc34a4f57a9f5e189cdeeb3dafab664 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,10 @@ default: - export FLYCTL_INSTALL="/root/.fly" && export PATH="$FLYCTL_INSTALL/bin:$PATH" deploy: + image: utdemir/ghc-musl:v24-ghc8107 script: + - cabal build exe:myapp --enable-executable-static --enable-executable-stripping + - cabal install installdir=. --enable-executable-static --enable-executable-stripping - flyctl deploy only: - tags \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9e1467f2abd3f5c50500feefa2c79651001c7b9c..d747b4abefb4ff266ed9ff581ee3d7acdddb483a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,5 @@ -FROM haskell:9.2-slim -RUN cabal update +FROM alpine EXPOSE 8080 -COPY flyio.cabal . -COPY CHANGELOG.md . -RUN cabal build --dependencies-only -COPY app ./app -COPY src ./src -RUN cabal install exe:flyio -ENTRYPOINT [ "flyio" ] \ No newline at end of file +RUN apk add gmp +COPY myapp myapp +ENTRYPOINT [ "./myapp" ] \ No newline at end of file diff --git a/flyio.cabal b/flyio.cabal index 8f56a27ca27087cff454477eff8d89d89be4684d..f70cf995b816c00cb677acb04f90e4a370915155 100644 --- a/flyio.cabal +++ b/flyio.cabal @@ -33,17 +33,18 @@ library -- LANGUAGE extensions used by modules in this package. -- other-extensions: build-depends: - aeson, - base ^>=4.16.3.0, - containers, - servant, - servant-server, - mtl, - text + aeson, + base, + containers, + servant, + servant-server, + mtl, + text, + time hs-source-dirs: src default-language: Haskell2010 -executable flyio +executable myapp main-is: Main.hs -- Modules included in this executable, other than Main. @@ -52,10 +53,10 @@ executable flyio -- LANGUAGE extensions used by modules in this package. -- other-extensions: build-depends: - base ^>=4.16.3.0, - containers, - flyio, - warp + base, + containers, + flyio, + warp hs-source-dirs: app default-language: Haskell2010 diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 12080c0c842f1fd2577f45238081c1fc9453908a..0000000000000000000000000000000000000000 --- a/stack.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# https://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# -# The location of a snapshot can be provided as a file or url. Stack assumes -# a snapshot provided as a file might change, whereas a url resource does not. -# -# resolver: ./custom-snapshot.yaml -# resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/11/3.yaml - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# subdirs: -# - auto-update -# - wai -packages: -- . -# Dependency packages to be pulled from upstream that are not in the resolver. -# These entries can reference officially published versions as well as -# forks / in-progress versions pinned to a git hash. For example: -# -# extra-deps: -# - acme-missiles-0.3 -# - git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# -# extra-deps: [] - -# Override default flag values for local packages and extra-deps -# flags: {} - -# Extra package databases containing global packages -# extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=2.7" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor diff --git a/stack.yaml.lock b/stack.yaml.lock deleted file mode 100644 index c870e65f1fdf2f804bf12556c64a38be2277c3a5..0000000000000000000000000000000000000000 --- a/stack.yaml.lock +++ /dev/null @@ -1,13 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: [] -snapshots: -- completed: - size: 646690 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/11/3.yaml - sha256: 5201b267da5c16bde723e0401eed332c96035edd55250a947089a7d9417b7ecc - original: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/11/3.yaml