Skip to content

Instantly share code, notes, and snippets.

@philm
Last active June 25, 2020 11:36
Show Gist options
  • Select an option

  • Save philm/a9b124f8f87a7fb9a3d9 to your computer and use it in GitHub Desktop.

Select an option

Save philm/a9b124f8f87a7fb9a3d9 to your computer and use it in GitHub Desktop.

Revisions

  1. Philip Misiowiec revised this gist Mar 11, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,15 @@ FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # Install any dependencies needed by Rails, followed by cleanup
    # Install any dependencies needed by Rails
    RUN apt-get update -q && \
    apt-get install -qy curl libpq-dev libqt4-dev xvfb imagemagick --no-install-recommends && \

    # install Node for asset minification
    curl -sL https://deb.nodesource.com/setup | bash - && \
    apt-get install -qy nodejs && \

    # cleanup
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
  2. Philip Misiowiec revised this gist Mar 11, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,12 @@ ENV DEBIAN_FRONTEND noninteractive

    # Install any dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && \
    apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick --no-install-recommends && \
    apt-get install -qy curl libpq-dev libqt4-dev xvfb imagemagick --no-install-recommends && \

    # install Node for asset minification
    curl -sL https://deb.nodesource.com/setup | bash - && \
    apt-get install -qy nodejs && \

    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
  3. Philip Misiowiec revised this gist Mar 11, 2015. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,7 @@ FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # If you don't want to use therubyracer gem or similar,
    # install Node.js as your preferred JS runtime
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
    # Install any dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && \
    apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick --no-install-recommends && \
    apt-get clean && \
  4. philm revised this gist Sep 25, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,8 @@ ENV DEBIAN_FRONTEND noninteractive
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick --no-install-recommends && \
    RUN apt-get update -q && \
    apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick --no-install-recommends && \
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
  5. philm revised this gist Sep 25, 2014. 3 changed files with 21 additions and 8 deletions.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND noninteractive
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick && \
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick --no-install-recommends && \
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
    6 changes: 6 additions & 0 deletions Procfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # optional - file only needed if using Foreman

    web: bundle exec puma -p $PORT -C ./config/puma.rb

    # other processes can be defined below
    # worker: bundle exec sidekiq
    21 changes: 14 additions & 7 deletions start
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,23 @@
    #!/usr/bin/env bash

    # optional
    truncate -s 0 log/*

    echo "Bundling gems"
    bundle install --jobs 4 --retry 3

    # sets up db only if it doesn't exist
    bundle exec rake db:version || { bundle exec rake db:setup; }
    echo "Generating Spring binstubs"
    bundle exec spring binstub --all

    echo "Clearing logs"
    bin/rake log:clear

    echo "Setting up new db if one doesn't exist"
    bin/rake db:version || { bundle exec rake db:setup; }

    echo "Removing contents of tmp dirs"
    bin/rake tmp:clear

    echo "Starting app server..."
    bundle exec rails s puma -p 3000
    echo "Starting app server"
    bundle exec rails s -p 3000

    # or use foreman
    # gem install foreman
    # foreman start
  6. philm revised this gist Sep 25, 2014. 2 changed files with 4 additions and 0 deletions.
    1 change: 1 addition & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@ RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb nodejs im
    ENV DEBIAN_FRONTEND newt

    ENV GEM_HOME /ruby_gems/2.1
    ENV PATH /ruby_gems/2.1/bin:$PATH

    ADD . /app
    WORKDIR /app
    3 changes: 3 additions & 0 deletions start
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,6 @@ bundle exec rake db:version || { bundle exec rake db:setup; }

    echo "Starting app server..."
    bundle exec rails s puma -p 3000

    # or use foreman
    # foreman start
  7. philm revised this gist Sep 20, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,8 @@ FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # for Node.js (needed as a JS runtime)
    # If you don't want to use therubyracer gem or similar,
    # install Node.js as your preferred JS runtime
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
  8. philm revised this gist Sep 20, 2014. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions start
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,10 @@
    truncate -s 0 log/*

    echo "Bundling gems"
    bundle install --jobs 3
    bundle install --jobs 4 --retry 3

    # if you don't want to rebuild the db
    # every time you start your container, then
    # remove this line
    bundle exec rake db:setup
    # sets up db only if it doesn't exist
    bundle exec rake db:version || { bundle exec rake db:setup; }

    echo "Starting app server..."
    bundle exec rails s puma -p 3000
  9. philm revised this gist Sep 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # for Node.js (needed to compile assets)
    # for Node.js (needed as a JS runtime)
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
  10. philm revised this gist Sep 17, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,11 @@ FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # for Node.js (needed to compile assets)
    RUN curl -sL https://deb.nodesource.com/setup | bash -

    # Install dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb imagemagick && \
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb nodejs imagemagick && \
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
  11. philm revised this gist Sep 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ FROM atlashealth/ruby:2.1.2
    ENV DEBIAN_FRONTEND noninteractive

    # Install dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb imagemagick node && \
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb imagemagick && \
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log
  12. philm revised this gist Sep 14, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions start
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    #!/usr/bin/env bash

    # optional
    truncate -s 0 log/*

    echo "Bundling gems"
    bundle install --jobs 3

  13. philm revised this gist Sep 14, 2014. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions start
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/usr/bin/env bash

    echo "Bundling gems"
    bundle install --jobs 3

    # if you don't want to rebuild the db
    # every time you start your container, then
    # remove this line
    bundle exec rake db:setup

    echo "Starting app server..."
    bundle exec rails s puma -p 3000
  14. philm created this gist Sep 13, 2014.
    19 changes: 19 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    FROM atlashealth/ruby:2.1.2

    ENV DEBIAN_FRONTEND noninteractive

    # Install dependencies needed by Rails, followed by cleanup
    RUN apt-get update -q && apt-get install -qy libpq-dev libqt4-dev xvfb imagemagick node && \
    apt-get clean && \
    cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* && \
    truncate -s 0 /var/log/*log

    # https://github.com/docker/docker/issues/4032
    ENV DEBIAN_FRONTEND newt

    ENV GEM_HOME /ruby_gems/2.1

    ADD . /app
    WORKDIR /app

    CMD ./script/start