Last active
August 25, 2019 08:24
-
-
Save WJWH/2d4cb80f2799256e8703d2e904d0b707 to your computer and use it in GitHub Desktop.
Generic dockerfile for statically compiled Crystal applications
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
# See https://wjwh.eu/posts/2019-07-21-static-crystal-images.html for the reasoning behind each line | |
# Build stage | |
FROM durosoft/crystal-alpine:0.28.0 as build | |
COPY shard.yml shard.yml | |
RUN shards install --production | |
COPY . ./ | |
RUN crystal build src/my_app.cr --release --static | |
# Release stage | |
FROM alpine:3.10 | |
COPY --from=0 my_app my_app | |
EXPOSE 3000 # Or whichever other port you want exposed, if any |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment