Rails & MySQL on Docker: Quick Start
This is a MySQL version of “Quickstart: Compose and Rails” . You can create a new Ruby on Rails project with MySQL (instead of PostgreSQL) using docker-compose. 0. setup Create a directory (with any name) for the project. mkdir rails cd rails 1. prepare five files Only docker-compose.yml is different from the original Quickstart documentation. Dockerfile FROM ruby:2.5 RUN apt-get update -qq && apt-get install -y nodejs postgresql-client RUN mkdir /myapp WORKDIR /myapp COPY Gemfile /myapp/Gemfile COPY Gemfile.lock /myapp/Gemfile.lock RUN bundle install COPY . /myapp # Add a script to be executed every time the container starts. COPY entrypoint.sh /usr/bin/ RUN chmod +x /usr/bin/entrypoint.sh ENTRYPOINT ["entrypoint.sh"] EXPOSE 3000 # Start the main process. CMD ["rails", "server", "-b", "0.0.0.0"] Gemfile source 'https://rubygems.org' gem 'rails', '~>5' Gemfile.lock (emp...