Created
June 10, 2020 15:48
-
-
Save joelmccracken/a1aef8d5bbfde90a9454bc605fb3e553 to your computer and use it in GitHub Desktop.
haskell on heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM fpco/stack-build:lts-12.26 | |
COPY . /opt/build | |
RUN cd /opt/build && stack build --system-ghc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
.