Skip to content

Commit

Permalink
[#246] Add base Dockerfile for Haskell backend dependencies
Browse files Browse the repository at this point in the history
Introduces a new Dockerfile.base within the govtool/backend directory,
aimed at creating a base image for the Haskell backend project. This
base image includes all necessary pre-compiled dependencies, following
the initiative to expedite the build process for deployment.

The Dockerfile is based on the `haskell:9.2-buster` image and sets up an
environment optimized for the GovTool project by pre-installing all
dependencies. By removing the source code after dependency installation,
we ensure that the image only contains what's necessary for future
builds, thus aligning with our goal to reduce build and deployment times
significantly.

This change addresses part of the acceptance criteria for speeding up
the deployment process by preparing and maintaining a base image with
all pre-compiled dependencies required by the application.
  • Loading branch information
placek committed Feb 21, 2024
1 parent 5bdfcc0 commit 98fd783
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions govtool/backend/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NOTE: This Dockerfile sets up an environment with precompiled dependencies for
# the GovTool Haskell backend project, streamlining the project's compilation
# process by ensuring it only needs to compile against these dependencies. This
# is a common practice in Haskell projects, as it can significantly reduce the
# time it takes to build the project.

FROM haskell:9.2-buster
WORKDIR /src
COPY . .
RUN cabal update && cabal configure && cabal install --only-dependencies && rm -rf /src/*

0 comments on commit 98fd783

Please sign in to comment.