Skip to content

Instantly share code, notes, and snippets.

@keiththomps
Last active August 25, 2016 00:31
Show Gist options
  • Select an option

  • Save keiththomps/d2a921ad96da120551d79a868533f641 to your computer and use it in GitHub Desktop.

Select an option

Save keiththomps/d2a921ad96da120551d79a868533f641 to your computer and use it in GitHub Desktop.
Script to ensure database is set up and run rails server
FROM ruby:2.3
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
postgresql-client \
&& rm -rf /var/lib/apt/lists
WORKDIR /usr/src/app
COPY Gemfile* ./
RUN bundle install
COPY . .
EXPOSE 3000
CMD bin/start
#!/usr/bin/env bash
# put this file in the bin directory of the rails app and make it executable with `chmod +x bin/start`
bin/rake db:create db:migrate
bin/rails server -b 0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment