diff --git a/Dockerfile b/Dockerfile index 06e8759..b6547b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,21 @@ -FROM haskell:9.2.8-slim-buster +FROM haskell:9.4.8-slim-buster + +ARG UID=1000 +ARG GID=1000 + +RUN groupadd -g ${GID} saundersp \ + && useradd -l -m -u "${UID}" -g "${GID}" saundersp + +USER saundersp WORKDIR /home/saundersp/haskell_playground RUN cabal update -COPY . . +COPY app app +COPY haskell-playground.cabal . RUN cabal build -ENTRYPOINT ["cabal", "run"] +ENTRYPOINT ["cabal"] +CMD ["run"] diff --git a/docker-compose.yaml b/docker-compose.yaml index b376a86..63aec66 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,6 +2,10 @@ services: haskell-playground: image: saundersp/haskell-playground pull_policy: never - build: . + build: + args: + UID: ${UID:-1000} + GID: ${GID:-1000} + user: ${UID:-1000}:${GID:-1000} volumes: - ./:/home/saundersp/haskell_playground diff --git a/haskell-playground.cabal b/haskell-playground.cabal index c24d167..daf6500 100644 --- a/haskell-playground.cabal +++ b/haskell-playground.cabal @@ -8,7 +8,7 @@ executable haskell-playground main-is: Main.hs build-depends: primes, - base ^>=4.16.4.0 + base ^>=4.17.2.1 other-modules: Primes Problems