Skip to content

Instantly share code, notes, and snippets.

@gitDbits
Last active November 1, 2019 02:33
Show Gist options
  • Select an option

  • Save gitDbits/60f6e1a8895b43cf716762157f412a6b to your computer and use it in GitHub Desktop.

Select an option

Save gitDbits/60f6e1a8895b43cf716762157f412a6b to your computer and use it in GitHub Desktop.
# Command create project
sudo docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new --skip-bundle my_awesome_app
# Create Dockerfile in project
FROM ruby:2.5.3
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/*
COPY Gemfile /usr/src/app/
RUN bundle install
COPY . /usr/src/app
EXPOSE 3000
CMD puma -C config/puma.rb
# Run command build docker
docker build -t name_app .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment