This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/docker/backend/Dockerfile

31 lines
1.2 KiB
Docker

FROM debian:12.5
RUN apt-get update && apt-get -y install inotify-tools
RUN apt-get -y update && apt-get -y install haskell-stack git
RUN apt-get -y update && apt-get -y install alex g++ happy libghc-zlib-dev libpq-dev libsodium-dev locales locales-all pkg-config
RUN apt-get -y update && apt-get -y install llvm
ENV LANG=en_US.UTF-8
# locally these two should be identical, so that compilation results are written out into the file dir.
# in CI-pipelines these two should be different, so that the container caches the compilation results.
ARG MOUNT_DIR=/mnt/fradrive
ARG PROJECT_DIR=/fradrive
RUN mkdir -p "${PROJECT_DIR}"
RUN if [ "${PROJECT_DIR}" != "${MOUNT_DIR}" ] ; then cp -r "${MOUNT_DIR}"/* "${PROJECT_DIR}" ; fi
WORKDIR "${PROJECT_DIR}"
ENV HOME="${PROJECT_DIR}"
RUN mkdir -p "${PROJECT_DIR}/.stack"
ENV STACK_ROOT="${PROJECT_DIR}/.stack"
RUN make -- --.stack STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true
RUN stack build yesod-bin
RUN chmod -R 777 .stack .stack-work-build .stack-work-run .stack-work-test .stack-work-doc || :
ENV FRADRIVE_MAKE_TARGET=start-backend
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} STACK_ROOT="${STACK_ROOT}" IN_CONTAINER=true CONTAINER_FILE="${CONTAINER_FILE}"
EXPOSE 3000/tcp
EXPOSE 3443/tcp