rails/docked

Usage of docked in developement env with new setup of rails main branch

navidemad opened this issue · 1 comments

II would firstly like to thank you for yours contributions on this project to make docker easier in development environment.

Source: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md

  • Add Docker files by default to new apps: Dockerfile, .dockerignore, bin/docker-entrypoint.
    These files can be skipped with --skip-docker. They're intended as a starting point for
    a production deploy of the application. Not intended for development (see Docked Rails for that).

    Example:

    docker build -t app .
    docker volume create app-storage
    docker run --rm -it -v app-storage:/rails/storage -p 3000:3000 --env RAILS_MASTER_KEY=<see config/master.key> app
    

    You can also start a console or a runner from this image:

    docker run --rm -it -v app-storage:/rails/storage --env RAILS_MASTER_KEY=<see config/master.key> app console
    

    To create a multi-platform image on Apple Silicon to deploy on AMD or Intel and push to Docker Hub for user/app:

    docker login -u <user>
    docker buildx create --use
    docker buildx build --push --platform=linux/amd64,linux/arm64 -t <user/image> .
    

    DHH, Sam Ruby

Could you manage do make RUBY_VERSION a build arg too so we can use the ruby-version of our choice ?

I can see that you are installing in the rails main branch the package yarn and npm through volta, is it something you planned to do the same with docked ?

And finally, could you make an example in the readme with the usage of a docker-compose which does the good practices for us to use it with redis and sidekiq ?

dhh commented

This setup is intended to be used primarily for people new to Rails. They should always be starting new apps on the latest version of Rails. And they shouldn't be compiling their own Docked Rails image either.

Don't want the complication of volta here.

Would like to look at a docker-compose example, but haven't found a path that's as simple as what we have here now. Will keep thinking, though.