Skip to content

Commit

Permalink
[#246] Update backend Dockerfile to use base image
Browse files Browse the repository at this point in the history
This commit updates the Dockerfile for the GovTool backend to utilize
the newly created base image, which contains all necessary pre-compiled
Haskell dependencies. By changing the base image from
`haskell:9.2-buster` to the custom `backend-base` image hosted on AWS
ECR, the build process for the backend Docker image is significantly
optimized.

The key changes include:
- Modifying the FROM directive to point to the `backend-base` image,
  ensuring that the environment is pre-setup with all the dependencies
  required for the backend build.
- Simplifying the build command to `cabal build` since `cabal update`,
  `cabal configure`, and dependency installations are no longer
  necessary, being already handled in the base image creation process.

This adjustment ensures that the backend Dockerfile leverages the
pre-compiled dependencies in the base image, directly contributing to a
faster build and deployment process. This change aligns with the
project's acceptance criteria by ensuring that only the
application-specific code is compiled during the build process,
leveraging the efficiencies offered by the base image.
  • Loading branch information
placek authored and MSzalowski committed Feb 23, 2024
1 parent 5338dde commit 754287a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM haskell:9.2-buster
FROM 733019650473.dkr.ecr.eu-west-1.amazonaws.com/backend-base:39906fb
WORKDIR /src
COPY . .
RUN cabal update && cabal configure && cabal build
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.8/vva-be-0.1.0.0/x/vva-be/build/vva-be/vva-be /usr/local/bin

0 comments on commit 754287a

Please sign in to comment.