Skip to content

Instantly share code, notes, and snippets.

@juanhuttemann
Last active May 29, 2018 02:16
Show Gist options
  • Save juanhuttemann/ac3355da78c80139f69cbfa43ed23fc3 to your computer and use it in GitHub Desktop.
Save juanhuttemann/ac3355da78c80139f69cbfa43ed23fc3 to your computer and use it in GitHub Desktop.
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
EXPOSE 3000
VOLUME /myapp
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
docker build -t image_name .
docker run -p 3000:3000 -d -v ~/my_app1:/myapp --name container_name image_name
docker exec -it container_name bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment