Skip to content

Instantly share code, notes, and snippets.

@joelmccracken
Created June 10, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelmccracken/a1aef8d5bbfde90a9454bc605fb3e553 to your computer and use it in GitHub Desktop.
Save joelmccracken/a1aef8d5bbfde90a9454bc605fb3e553 to your computer and use it in GitHub Desktop.
haskell on heroku
FROM bec-baseimage as build
COPY . /opt/build
RUN cd /opt/build && stack build --system-ghc
FROM ubuntu:16.04
RUN mkdir -p /bec
ARG BINARY_PATH
WORKDIR /bec
RUN apt-get update && apt-get install -y \
ca-certificates \
libgmp-dev \
wget curl gnupg2 postgresql-server-dev-all postgresql-client
# NOTICE THIS LINE
COPY --from=build /opt/build/.stack-work/install/x86_64-linux/lts-12.26/8.4.4/bin .
COPY static /bec/static
COPY config /bec/config
CMD ["/bec/bec"]
FROM fpco/stack-build:lts-12.26
COPY . /opt/build
RUN cd /opt/build && stack build --system-ghc
baseimage:
docker build -f Dockerfile.baseimage -t bec-baseimage .
deploy-heroku:
heroku container:push web -a bec-app
heroku container:release web -a bec-app
@joelmccracken
Copy link
Author

baseimage is handy to reduce build times.

when i want to deploy, i run make deploy-heroku.

if i need to change something in the base image (or rebuild it for whatever reason), make baseimage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment