Skip to content

Instantly share code, notes, and snippets.

View and-pete's full-sized avatar

Peter Kjeld Andersen and-pete

  • Sydney, Australia
View GitHub Profile
@and-pete
and-pete / Dockerfile
Created August 30, 2020 13:08
Multi-Stage Docker Build for a Haskell (Stack) Project
# The below is a combination of the following two things:
# 1) This article + corresponding Gist: https://medium.com/permutive/optimized-docker-builds-for-haskell-76a9808eb10b
# 2) This Reddit comment in response to the above:
# - https://www.reddit.com/r/haskell/comments/cl5uod/optimized_docker_builds_for_haskell/evuzccm/
# It is a multi-stage Docker build with 3 stages: 1) dependencies, 2) build, and 3) deploy
# -------------------------------------------------------------------------------------------
# STAGE 1: Dependencies
# -------------------------------------------------------------------------------------------
FROM haskell:8.10.2 as dependencies