Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generic dockerfile for statically compiled Crystal applications
# See 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/ --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