Skip to content

Instantly share code, notes, and snippets.

Last active September 23, 2017 18:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Crystal Docker for development
FROM crystallang/crystal:0.22.0
# copy all your app files/directories to image
COPY static ./static
COPY dev ./dev
COPY spec ./spec
COPY src ./src
COPY shard.yml ./shard.yml
# install crystal deps
RUN shards install
RUN crystal build --release dev/ -o ./sentry
# run sentry, which starts app and watches files
CMD ./sentry
# build image
docker build -f dev.dockerfile -t my_app .
# run image
# port 7777 on local machine is mapped to port 80 in container
docker run --name my_app -p 7777:80 my_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment