luckyframework / website-old

The old website for Lucky (archived)
https://github.com/luckyframework/website-v2
MIT License
11 stars 29 forks source link

Added guide for Deploying Lucky app with Docker #99

Open nicbet opened 6 years ago

nicbet commented 6 years ago

A guide that describes how to build a docker container image of your Lucky app for deployment. Background: https://gitter.im/luckyframework/Lobby?at=5a67a423e0141226508243c0

paulcsmith commented 6 years ago

Thanks for writing this @nicbet and thanks for taking a look @hanneskaeufler. I don't have much experience with Docker so I appreciate your input.

hanneskaeufler commented 6 years ago

@nicbet do you think it is reasonable to assume that someone using this guide has already set up his app locally? I am asking because the Dockerfile does not do crystal deps or yarn install. Not saying that is wrong, but I am wondering what the docker-ers (? 🤓) out there are doing. Myself e.g. I am building and running the app in docker (sometimes). Thats why the dockerfile looks more like

FROM hanneskaeufler/crystal-node-ruby

# add application code
ADD . /app
WORKDIR /app

# install app dependencies (crystal)
RUN crystal deps

# install app dependencies (node)
RUN yarn install

# precompile assets (via brunch)
RUN ./bin/compile_assets build --production

RUN crystal build src/server.cr
CMD ./server

I DO think it is a good idea not to go into docker-compose (for database e.g) straight away. Maybe in a tiny section in the end?

nicbet commented 6 years ago

@hanneskaeufler you make a good point. I think the focus of the guide as on deployment via Docker, rather than using a Crystal Docker container as a development environment (which I am doing with pretty much every language myself these days). To develop using a Docker image, you'd have to create a new base image (like you have done with hanneskauefler/crystal-node-ruby) and add all required dependencies (such as node) into the image.

I'm okay with adding an additional section, or perhaps a separate guide.