Updated Dockerfile base image and fixed runtime permissions

This commit is contained in:
saundersp 2025-01-19 22:42:53 +01:00
parent 66bcee129b
commit 65f3525ffd
3 changed files with 19 additions and 5 deletions

View File

@ -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 WORKDIR /home/saundersp/haskell_playground
RUN cabal update RUN cabal update
COPY . . COPY app app
COPY haskell-playground.cabal .
RUN cabal build RUN cabal build
ENTRYPOINT ["cabal", "run"] ENTRYPOINT ["cabal"]
CMD ["run"]

View File

@ -2,6 +2,10 @@ services:
haskell-playground: haskell-playground:
image: saundersp/haskell-playground image: saundersp/haskell-playground
pull_policy: never pull_policy: never
build: . build:
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
user: ${UID:-1000}:${GID:-1000}
volumes: volumes:
- ./:/home/saundersp/haskell_playground - ./:/home/saundersp/haskell_playground

View File

@ -8,7 +8,7 @@ executable haskell-playground
main-is: Main.hs main-is: Main.hs
build-depends: build-depends:
primes, primes,
base ^>=4.16.4.0 base ^>=4.17.2.1
other-modules: other-modules:
Primes Primes
Problems Problems