Last active
September 23, 2017 18:43
-
-
Save samueleaton/d112ab5cfac7b707fdd2b1e4ec110d43 to your computer and use it in GitHub Desktop.
Crystal Docker for development
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 crystallang/crystal:0.22.0 | |
MAINTAINER [email protected] | |
WORKDIR /app | |
# 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/sentry_cli.cr -o ./sentry | |
# run sentry, which starts app and watches files | |
CMD ./sentry |
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
# 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