This repository has been archived by the owner on May 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from marmelab/ruby_template
[RFR] Introduce ruby template
- Loading branch information
Showing
34 changed files
with
361 additions
and
157 deletions.
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
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,20 @@ | ||
applications: | ||
app: | ||
type: ror | ||
volumes: | ||
.: /app | ||
ports: | ||
8080: 8080 | ||
links: [db] | ||
custom: | ||
project_name: ror | ||
documentRoot: /app/ror/public | ||
serverType: apache | ||
|
||
db: | ||
type: mysql | ||
ports: | ||
3306: 3306 | ||
after_script: mysql -e "CREATE DATABASE IF NOT EXISTS ror_development CHARACTER SET utf8 COLLATE utf8_general_ci;" -uroot | ||
volumes: | ||
.gaudi/mysql: /var/lib/mysql |
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,11 @@ | ||
applications: | ||
app: | ||
type: ruby | ||
volumes: | ||
.: /app | ||
after_script: ruby /app/hello.rb | ||
#custom: | ||
# version: 2.1.2 | ||
|
||
# sudo gaudi | ||
# sudo docker logs app |
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 @@ | ||
puts "Hello from ruby\n" |
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,19 +1,19 @@ | ||
[[ if (.Container.HasBeforeScript) ]] | ||
[[ if (.Container.HasBeforeScriptFile) ]] | ||
ADD [[.Container.BeforeScript]] /root/before-setup.sh | ||
[[ else ]] | ||
RUN echo '[[.Container.BeforeScript]]' > /root/before-setup.sh | ||
[[ end ]] | ||
[[ if (.Container.HasBeforeScriptFile) ]] | ||
ADD [[.Container.BeforeScript]] /root/before-setup.sh | ||
[[ else ]] | ||
RUN echo '[[.Container.BeforeScript]]' > /root/before-setup.sh | ||
[[ end ]] | ||
|
||
RUN chmod +x /root/before-setup.sh | ||
RUN chmod +x /root/before-setup.sh | ||
[[ end ]] | ||
|
||
[[ if (.Container.HasAfterScript) ]] | ||
[[ if (.Container.HasAfterScriptFile) ]] | ||
ADD [[.Container.AfterScript]] /root/after-setup.sh | ||
[[ else ]] | ||
RUN echo '[[.Container.AfterScript]]' > /root/after-setup.sh | ||
[[ end ]] | ||
[[ if (.Container.HasAfterScriptFile) ]] | ||
ADD [[.Container.AfterScript]] /root/after-setup.sh | ||
[[ else ]] | ||
RUN echo '[[.Container.AfterScript]]' > /root/after-setup.sh | ||
[[ end ]] | ||
|
||
RUN chmod +x /root/after-setup.sh | ||
RUN chmod +x /root/after-setup.sh | ||
[[ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Install nodejs with nvm | ||
[[ $nodeVersion := .Container.GetCustomValue "nodeVersion" (.Container.GetCustomValue "version" "0.10.20")]] | ||
|
||
RUN git clone https://github.com/creationix/nvm.git /.nvm | ||
#RUN echo "/.nvm/nvm.sh" >> /etc/bash.bashrc | ||
RUN /bin/bash -c '. /.nvm/nvm.sh && nvm install v[[ $nodeVersion ]] && nvm use v[[ $nodeVersion ]] && nvm alias default v[[ $nodeVersion ]] && ln -s /.nvm/v[[ $nodeVersion ]]/bin/node /usr/bin/node && ln -s /.nvm/v[[ $nodeVersion ]]/bin/npm /usr/bin/npm' |
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,14 @@ | ||
# Install ruby via RVM | ||
[[ $version := (.Container.GetCustomValue "version" "2.1.2") ]] | ||
|
||
RUN apt-get install -y --reinstall procps | ||
RUN curl -L https://get.rvm.io | bash -s stable | ||
|
||
ENV PATH /usr/local/rvm/bin/:$PATH | ||
ENV PATH /usr/local/rvm/rubies/ruby-[[ $version ]]/bin/:$PATH | ||
ENV PATH /usr/local/rvm/gems/ruby-[[ $version ]]/bin/:$PATH | ||
|
||
RUN rvm install [[ $version ]] | ||
RUN rvm use [[ $version ]] --default | ||
|
||
|
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,57 +1,59 @@ | ||
<VirtualHost *:[[ .Container.GetFirstLocalPort ]]> | ||
ServerAdmin webmaster@localhost | ||
|
||
[[ $documentRoot := (.Container.GetCustomValue "documentRoot") ]] | ||
[[ if $documentRoot ]] | ||
DocumentRoot [[ $documentRoot ]] | ||
[[ else ]] | ||
DocumentRoot /var/www | ||
[[ end ]] | ||
<Directory /> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
</Directory> | ||
|
||
[[ if $documentRoot ]] | ||
ServerAdmin webmaster@localhost | ||
|
||
[[ $documentRoot := (.Container.GetCustomValue "documentRoot") ]] | ||
[[ if $documentRoot ]] | ||
DocumentRoot [[ $documentRoot ]] | ||
[[ else ]] | ||
DocumentRoot /var/www | ||
[[ end ]] | ||
<Directory /> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
</Directory> | ||
|
||
[[ if $documentRoot ]] | ||
<Directory [[ $documentRoot ]]> | ||
[[ else ]] | ||
<Directory /var/www/> | ||
[[ end ]] | ||
Options Indexes FollowSymLinks MultiViews | ||
AllowOverride All | ||
Order allow,deny | ||
allow from all | ||
</Directory> | ||
Options Indexes FollowSymLinks MultiViews | ||
AllowOverride All | ||
Order allow,deny | ||
allow from all | ||
</Directory> | ||
|
||
[[ if(.Container.DependsOf "django" )]] | ||
[[ $django := (.Collection.GetType "django") ]] | ||
WSGIScriptAlias / /app/[[ (.Collection.GetType "django").GetCustomValue "project_name" "project" ]]/wsgi.py | ||
[[ if(.Container.DependsOf "django" )]] | ||
[[ $django := (.Collection.GetType "django") ]] | ||
WSGIScriptAlias / /app/[[ $django.GetCustomValue "project_name" "project" ]]/wsgi.py | ||
|
||
Alias /static/admin /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin | ||
Alias /static/ /app/[[ $django.GetCustomValue "project_name" "project" ]]/[[ $django.GetCustomValue "app_name" "myapp" ]]/static/ | ||
Alias /uploads/ /app/uploads/ | ||
[[ end ]] | ||
[[ end ]] | ||
|
||
<Directory "/usr/lib/cgi-bin"> | ||
AllowOverride None | ||
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
|
||
<Directory "/usr/lib/cgi-bin"> | ||
AllowOverride None | ||
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
# Possible values include: debug, info, notice, warn, error, crit, | ||
# alert, emerg. | ||
LogLevel warn | ||
|
||
# Possible values include: debug, info, notice, warn, error, crit, | ||
# alert, emerg. | ||
LogLevel warn | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
[[ $fastCgi := .Collection.Get (.Container.GetCustomValueAsString "fastCgi") (.Collection.GetType "php-fpm") ]] | ||
[[ if $fastCgi ]] | ||
[[ $fastCgiIdleTimeout := .Container.GetCustomValue "fastCgiIdleTimeout" "30" ]] | ||
[[ $fastCgiPath := "/var/www/cgi-bin/php5.external" ]] | ||
|
||
[[ $fastCgi := .Collection.Get (.Container.GetCustomValueAsString "fastCgi") (.Collection.GetType "php-fpm") ]] | ||
[[ $fastCgiIdleTimeout := .Container.GetCustomValue "fastCgiIdleTimeout" "30" ]] | ||
[[ if $fastCgi ]] | ||
FastCgiExternalServer /var/www/cgi-bin/php5.external -host ${[[ $fastCgi.Name | ToUpper ]]_PORT_[[ $fastCgi.GetFirstLocalPort ]]_TCP_ADDR}:${[[ $fastCgi.Name | ToUpper ]]_PORT_[[ $fastCgi.GetFirstLocalPort]]_TCP_PORT} -idle-timeout [[ $fastCgiIdleTimeout ]] | ||
Alias /cgi-bin/ /var/www/cgi-bin/ | ||
[[end]] | ||
FastCgiExternalServer [[ $fastCgiPath ]] -host ${[[ $fastCgi.Name | ToUpper ]]_PORT_[[ $fastCgi.GetFirstLocalPort ]]_TCP_ADDR}:${[[ $fastCgi.Name | ToUpper ]]_PORT_[[ $fastCgi.GetFirstLocalPort]]_TCP_PORT} -idle-timeout [[ $fastCgiIdleTimeout ]] | ||
Alias /cgi-bin/ /var/www/cgi-bin/ | ||
[[end]] | ||
</VirtualHost> | ||
|
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,10 +1,10 @@ | ||
<IfModule mod_fastcgi.c> | ||
AddHandler php5-fcgi .php | ||
Action php5-fcgi /cgi-bin/php5.external | ||
AddHandler php5-fcgi .php | ||
Action php5-fcgi /cgi-bin/php5.external | ||
|
||
<Location "/cgi-bin/php5.external"> | ||
Order Deny,Allow | ||
Deny from All | ||
Allow from env=REDIRECT_STATUS | ||
</Location> | ||
<Location "/cgi-bin/php5.external"> | ||
Order Deny,Allow | ||
Deny from All | ||
Allow from env=REDIRECT_STATUS | ||
</Location> | ||
</IfModule> |
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
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
Oops, something went wrong.