Created
April 5, 2024 14:49
-
-
Save yuriihabrusiev/3d7e7fecbd0dc8421eaa2f3db23ea085 to your computer and use it in GitHub Desktop.
Docked Rails
This file contains hidden or 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
# Docked Rails | |
# Building: | |
# docker build -t docked-rails . | |
# Preparation: | |
# docker volume create ruby-bundle-cache | |
# alias docked='docker run --rm -it -v ${PWD}:/rails -u $(id -u):$(id -g) -v ruby-bundle-cache:/bundle -p 3030:3030 docked-rails' | |
# Usage: | |
# docked rails db:migrate | |
# docked rails server | |
ARG RUBY_VERSION=2.6.5 | |
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base | |
RUN apt-get update -qq && \ | |
apt-get install --no-install-recommends -y git build-essential pkg-config libpq-dev libvips | |
WORKDIR /rails | |
RUN mkdir /bundle && chmod -R ugo+rwt /bundle | |
VOLUME /bundle | |
ENV BUNDLE_PATH='/bundle' | |
ENV PATH="/bundle/ruby/$RUBY_VERSION/bin:${PATH}" | |
ENV BUNDLER_VERSION=2.4.7 | |
RUN gem install bundler -v $BUNDLER_VERSION | |
ENV BINDING="0.0.0.0" | |
ENTRYPOINT [""] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment