Comment

Comment by mbell

There are a couple weird things in here:

    COPY drkiq/Gemfile Gemfile
    WORKDIR /opt/app/drkiq
    RUN bundle install
This appears to be leaving out copying Gemfile.lock so you have no real idea what versions of dependencies are being installed here. This is not safe. Also it's installing a bunch of dependencies that are not needed in production, a better bundle command would be something like: `RUN bundle install --no-cache --jobs 4 --without development test`

    RUN rails webpacker:install
    RUN rails assets:precompile
Why is `rails webpacker:install` being run here? This is very odd. As a general tip, I would also not compile assets as part of the docker build, but rather externally then only copy over the `public` directory afterward. This removes any need for `node` or any related development tools/packages in the production image.
parent mbell 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton