This file contains hidden or 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
# Make PHP app Dokku-friendly | |
# Add staging and production clauses to database.yml | |
# Tell docker how to start app, Add to Procfile (web server dependant) | |
# Simple puma setup | |
Make Procfile, add line: | |
web: bundle exec puma -t ${PUMA_MIN_THREADS:-1}:${PUMA_MAX_THREADS:-1} -w ${PUMA_WORKERS:-2} -p $PORT -e ${RACK_ENV:-production} | |
# Simple unicorn setup: | |
Make Procfile, add line: | |
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
Make config/unicorn.rb, populate with default pre and post-fork blocks |
This file contains hidden or 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
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# Code is not reloaded between requests. | |
config.cache_classes = true | |
config.eager_load = false | |
# Full error reports are disabled and caching is turned on. | |
config.consider_all_requests_local = true |
This file contains hidden or 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
# Static html serving via dokku: | |
1. make .env in root, include the line “export BUILDPACK_URL=https://github.com/florianheinemann/buildpack-nginx.git”; | |
2. make .static (an empty file for buildpack to pick up it will be a static app) | |
3. make www directory | |
4. place index.html along with .css into www folder to be served. (Assets come in www/assets/) | |
5. init git remote | |
$ git remote add dokku [email protected]:<domain.com> | |
6. $ git push dokku master | |
7. visit working site. |
This file contains hidden or 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
s = "" | |
until s == "q" do | |
puts "Enter integers" | |
s = gets.chomp | |
r = s.split("").inject(0){|c,x| c + x.to_i } | |
puts "The sum is #{r}" | |
end |
This file contains hidden or 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
========== RSpec Workflow ========== | |
1 # Add gem stack | |
group :development, :test do | |
# Test stack | |
gem "rspec-rails", '~> 3.2.0' | |
gem "spring-commands-rspec" #Spring for rspec ^ | |
gem "factory_girl_rails" | |
gem "guard-rspec" | |
gem 'rb-fsevent', '~> 0.9.1' | |
gem "faker" #šis ģenerē dummy/fake datus pēc pieprasījuma |
This file contains hidden or 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
upstream puma { | |
server unix:/tmp/puma.socket fail_timeout=1; | |
} | |
server { | |
listen 80; | |
server_name <IP>; | |
return 307 http://www.google.lv$request_uri; | |
} |
This file contains hidden or 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
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
c2ca257ba902 dokku/node:latest "/start web" 27 minutes ago Up 27 minutes reverent_franklin | |
7f0d4f5753d3 de9c63fa4504 "/bin/bash -c 'mkdir 27 minutes ago Exited (0) 27 minutes ago drunk_yalow | |
41bff5625e88 6e724a2af1a6 "/bin/bash -c 'mkdir 27 minutes ago Exited (0) 27 minutes ago sleepy_rosalind | |
1e4bb3a5a462 6e724a2af1a6 "/start web" 32 minutes ago Exited (137) 26 minutes ago reverent_sammet | |
d75f4e581ea4 126ee263be14 "/bin/bash -c 'mkdir 32 minutes ago Exited (0) 32 minutes ago loving_mayer | |
a7c30c082f6b |
This file contains hidden or 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
Directer git:(master) git push dokku master | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LC_CTYPE = "UTF-8", | |
LANG = "en_US.UTF-8" | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). | |
Counting objects: 774, done. |
This file contains hidden or 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
node-js-sample git:(master) git push dokku master | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LC_CTYPE = "UTF-8", | |
LANG = "en_US.UTF-8" | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). | |
Counting objects: 381, done. |
This file contains hidden or 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
# /config/puma.rb | |
app = "manabalss" # App-specific | |
root = "/home/deployer/apps/#{app}" | |
workers 5 | |
threads 1, 1 # relying on many workers for thread-unsafe apps | |
rackup DefaultRackup | |
port 11592 |