This repository has been archived by the owner on May 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
YACS on Docker! #135
Merged
Merged
YACS on Docker! #135
Changes from all commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
8098fd0
adds docker config for rails, postgres, redis, nginx
Bad-Science 2068bba
fix docker-compose postgres ports and and duplicate volume commnds
Bad-Science c123293
fixes docker links and ports, prepare for production environment
Bad-Science 6962eb5
adds mkdir for puma pid to dockerfile
Bad-Science ae00af4
adds mkdir for puma pid to dockerfile
Bad-Science 742bcc2
moves puma pid path creation
Bad-Science f0685fd
moves puma state path to /var...
Bad-Science 512b5a8
moves web volume to dockerfile
Bad-Science 8fc3894
location of app in nginx container to match web container and get vol…
Bad-Science fff9fa8
adds volumes back to dockerfile
Bad-Science b654726
remove assets precompilation from dockerfile
Bad-Science 828c3c2
adds mime types to nginx conf
Bad-Science f54bd0e
add data folder for postgres
Bad-Science 4be0aef
remove keep files
Bad-Science c672a76
[attempt] updates .travis.yml to work with docker
Bad-Science 1721dd4
adds phantomjs to container for testing
Bad-Science 49cd082
remove ruby from travis config
Bad-Science 8cb18b9
adds install to travis
Bad-Science 59a602f
[attempt] install phantomjs from source
Bad-Science 099ccfa
[attempt2] install phantomjs from source
Bad-Science a1b63e2
add postgres to travis
Bad-Science 266bbda
add travis install
Bad-Science 436d0c0
uhh
Bad-Science 7a1c523
use npm to install phantomjs
Bad-Science bdf606f
get phantomjs from bitbucket (again)
Bad-Science 3226087
move rails docker-compose config to common file, move prod secrets to…
Bad-Science 11f8385
fix common services
Bad-Science bae34dd
remove extra line from docker-compose
Bad-Science 8d663a6
set version of common compose file to 2:
Bad-Science 36c7994
remoces docker-compose.common.yml
Bad-Science 2fadaab
add puma env vars to docker
Bad-Science 2888adb
Docker NGINX HTTPS Support
robinm8 087d6d4
Modify Dockerfiles, Puma Config
robinm8 bb2617a
Modify Nginx Config
robinm8 52fe43d
Merge pull request #169 from YACS-RCOS/staging
Bad-Science 10bbacf
Modify Dockerfiles, Configurations
robinm8 fedc8bb
Modify Configurations
robinm8 665b608
Create .gitignore In nginx/ssl
robinm8 f30b7c2
Revise Dockerfiles, No Args
robinm8 9330961
merge master into docker
Bad-Science 851548e
Modify .env
robinm8 b71f2bf
Modify .gitignore
robinm8 6197564
Merge remote-tracking branch 'master/docker' into docker
robinm8 681f8e4
Fix .travis.yml
robinm8 2a0d96d
Fix Upstream
robinm8 70bb0cb
Fix Gemfile
robinm8 f90b124
Revert "Fix Gemfile"
robinm8 f7ebf68
Modify Dockerfile
robinm8 c87f40f
Modify Puma Port
robinm8 3f322cd
fix travis config
Bad-Science 0d5eb37
checks Gemfile.lock back in
Bad-Science fe4c6f4
Pull .gitignore
robinm8 5c07257
adds scripts for docker operations
Bad-Science ac272d9
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
robinm8 2d72323
Modify Dockerfile
robinm8 72bf7f4
fix phantomjs install (uses release on phantomjs github, see https://…
Bad-Science 825f335
Update Nginx SSL Ciphers
robinm8 cae959c
Modify nginx.config
robinm8 8b6e074
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
robinm8 5906849
Modify Gemfile
robinm8 ae7d35b
adds sleep to travis
Bad-Science 8540fbd
fix travis
Bad-Science dfeb01b
Modify Dockerfile
robinm8 e6fe00b
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
robinm8 072290c
Revert "Modify Gemfile"
robinm8 84bbcc3
remove commented lines of Dockerfile
Bad-Science d4b55f7
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
robinm8 6fce328
adds script to generate dev certs
Bad-Science 1cc1356
Merge pull request #165 from robinm8/docker
Bad-Science e01bcca
Update Nginx.conf
robinm8 2c2b6a6
fix cert script
Bad-Science 9d6dfbc
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
Bad-Science 09ee505
Modify Nginx.conf
robinm8 0da120f
Merge pull request #188 from robinm8/docker
Bad-Science 6c44402
Merge branch 'docker' of github.com:YACS-RCOS/yacs into docker
Bad-Science 325c1ad
fix scripts
Bad-Science 23cf345
update scripts to work in any working directory and move to /bin
Bad-Science 009af9c
fix travis
Bad-Science 9dfffb1
add update and deploy scripts
Bad-Science f49626a
fix deploy
Bad-Science 2a88572
fix scripts
Bad-Science dbd51d3
updates version string
Bad-Science 675347a
updates version string
Bad-Science 512231f
updates version string
Bad-Science File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RAILS_ENV=development | ||
WEB_CONCURRENCY=1 | ||
MAX_THREADS=4 | ||
SECRET_TOKEN=temp | ||
SECRET_KEY_BASE=temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,5 @@ | |
# Ignore tern files | ||
\.tern-port | ||
|
||
/coverage/ | ||
/coverage/ | ||
/data/**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
language: ruby | ||
rvm: | ||
- 2.2.3 | ||
before_install: | ||
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 | ||
- tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2 | ||
- sudo rm -rf /usr/local/phantomjs/bin/phantomjs | ||
- sudo mv phantomjs /usr/local/phantomjs/bin/phantomjs | ||
before_script: | ||
- psql -c 'create database "yacs-test";' -U postgres | ||
sudo: required | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
- RAILS_ENV=test | ||
|
||
install: | ||
- bin/yacs-build | ||
- bin/yacs-startd && docker ps | ||
- sleep 10 | ||
- bin/yacs-dbsetup | ||
|
||
script: | ||
- bin/yacs-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ruby:2.2.3 | ||
|
||
MAINTAINER Richie Young <richiejoeyoung@gmail.com> | ||
|
||
RUN apt-get update && apt-get install -qq -y build-essential nodejs wget --fix-missing --no-install-recommends | ||
|
||
ENV PHANTOMJS_VERSION 2.1.1 | ||
RUN \ | ||
apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 && \ | ||
wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://github.com/paladox/phantomjs/releases/download/2.1.7/phantomjs-2.1.1-linux-x86_64.tar.bz2 && \ | ||
tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp && \ | ||
rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ | ||
mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/phantomjs | ||
|
||
ENV INSTALL_PATH /usr/src/app/ | ||
RUN mkdir -p $INSTALL_PATH | ||
RUN mkdir -p /var/run/puma | ||
|
||
WORKDIR $INSTALL_PATH | ||
COPY Gemfile Gemfile.lock $INSTALL_PATH | ||
|
||
RUN bundle install | ||
COPY . $INSTALL_PATH | ||
|
||
RUN mkdir -p /etc/puma/ssl | ||
COPY nginx/ssl/ /etc/puma/ssl/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ json.sections sections do |section| | |
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web rake assets:precompile && rm -f public/index.html | ||
chmod -f a+r public/* || : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
mkdir -p data/potsgres | ||
docker-compose run web bundle exec rake db:create db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx/ssl/yacs.key -out nginx/ssl/yacs.cer -subj "/C=US/ST=New York/L=Troy/O=RPI/OU=RCOS/CN=yacs.cs.rpi.edu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
RAILS_ENV=test docker-compose run web bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
git pull origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
bin/yacs-update | ||
bin/yacs-build | ||
bin/yacs-dbsetup | ||
bin/yacs-stop | ||
bin/yacs-assets | ||
bin/yacs-startd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,5 @@ | |
|
||
# Raises error for missing translations | ||
# config.action_view.raise_on_missing_translations = true | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server | ||
|
||
workers Integer(ENV['WEB_CONCURRENCY'] || 2) | ||
workers Integer(ENV['WEB_CONCURRENCY'] || 4) | ||
threads_count = Integer(ENV['MAX_THREADS'] || 5) | ||
threads threads_count, threads_count | ||
|
||
preload_app! | ||
|
||
rackup DefaultRackup | ||
port ENV['PORT'] || 3000 | ||
environment ENV['RACK_ENV'] || 'development' | ||
environment ENV['RAILS_ENV'] || 'development' | ||
|
||
if ENV['DSTATEDIR'] | ||
pidfile "#{ENV['DSTATEDIR']}puma.pid" | ||
state_path "#{ENV['DSTATEDIR']}puma.state" | ||
daemonize true | ||
end | ||
ssl_bind '0.0.0.0', '3000', { | ||
key: "/etc/puma/ssl/yacs.key", | ||
cert: "/etc/puma/ssl/yacs.cer" | ||
} | ||
|
||
pidfile "/var/run/puma/puma.pid" | ||
state_path "/var/run/puma/puma.state" | ||
|
||
on_worker_boot do | ||
# Worker specific setup for Rails 4.1+ | ||
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot | ||
ActiveRecord::Base.establish_connection | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p ./data/postgres | ||
mkdir -p ./data/redis | ||
mkdir -p ./tmp/pids/puma | ||
|
||
docker-compose down | ||
docker-compose build | ||
docker-compose run web rm public/index.html | ||
docker-compose run web bundle exec rake db:create db:migrate | ||
docker-compose run web bundle exec rake assets:precompile | ||
docker-compose up -d |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see travis-ci/travis-ci#4842