Last active
June 11, 2018 21:56
-
-
Save alunduil/a026c7d5fb7cbeef06d626f2605109a6 to your computer and use it in GitHub Desktop.
Haskell Cloud Build to Heroku
This file contains hidden or 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
steps: | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'pull', 'gcr.io/$PROJECT_ID/builder-api.dungeon.studio' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'pull', 'gcr.io/$PROJECT_ID/api.dungeon.studio' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'build', | |
'--cache-from', 'gcr.io/$PROJECT_ID/builder-api.dungeon.studio', | |
'--cache-from', 'gcr.io/$PROJECT_ID/api.dungeon.studio', | |
'-t', '$_IMAGE_NAME', | |
'-f', 'Dockerfile', '.' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'login', '--username=_', '--password=$_HEROKU_API_KEY', 'registry.heroku.com' ] | |
images: | |
- '$_IMAGE_NAME' | |
timeout: 60m |
This file contains hidden or 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 alpine:3.7 as builder | |
MAINTAINER Alex Brandt <[email protected]> | |
RUN apk add --no-cache musl-dev zlib-dev | |
RUN apk add --no-cache cabal ghc | |
WORKDIR /usr/local/src/api.dungeon.studio | |
RUN cabal update | |
COPY ./*.cabal ./ | |
RUN cabal install -j --only-dependencies | |
COPY . ./ | |
RUN cabal build -j --ghc-options="-static -optc-static -optl-static -optl-pthread" | |
FROM alpine:3.7 | |
MAINTAINER Alex Brandt <[email protected]> | |
RUN apk add --no-cache ca-certificates | |
COPY --from=builder /usr/local/src/api.dungeon.studio/dist/build/api-dungeon-studio/api-dungeon-studio / | |
ENTRYPOINT [ "/api-dungeon-studio" ] | |
CMD [ "Thanks Heroku!" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment