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
# Rename local branch | |
git branch -m old new | |
# Remove old branch | |
git push origin :old | |
# Create and push the new branch and set the local branch to track the new remote branch | |
git push --set-upstream origin new |
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
default: &default | |
adapter: postgresql | |
encoding: unicode | |
host: db | |
port: 5432 | |
username: postgres | |
password: <%= ENV['POSTGRES_PASSWORD'] %> | |
development: | |
<<: *default |
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
# Where our application lives. $RAILS_ROOT is defined in our Dockerfile. | |
app_path = ENV['RAILS_ROOT'] | |
# Set the server's working directory | |
working_directory app_path | |
# Define where Unicorn should write its PID file | |
pid "#{app_path}/tmp/pids/unicorn.pid" | |
# Bind Unicorn to the container's default route, at port 3000 |
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
# This is a template. Referenced variables (e.g. $RAILS_ROOT) need | |
# to be rewritten with real values in order for this file to work. | |
# To learn about all the directives used here, and more, see | |
# http://nginx.org/en/docs/dirindex.html | |
# define our application server | |
upstream unicorn { | |
server app:3000; | |
} |
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
# build from the official Nginx image | |
FROM nginx | |
# install essential Linux packages | |
RUN apt-get update -qq && apt-get -y install apache2-utils | |
# establish where Nginx should look for files | |
ENV RAILS_ROOT /var/www/myapp | |
# Set our working directory inside the image |
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
# service configuration for production database (Postgres) | |
db: | |
# use stock postgres image | |
image: postgres:9.4.5 | |
# persist the database between containers by storing it in a volume | |
volumes: | |
- myapp-postgres:/var/lib/postgresql/data |
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
#!/usr/bin/env bash | |
# Prefix `bundle` with `exec` so unicorn shuts down gracefully on SIGTERM (i.e. `docker stop`) | |
exec bundle exec unicorn -c config/containers/unicorn.rb -E $RAILS_ENV; |
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
.git | |
.env | |
.dockerignore |
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
# use SSHKit directly instead of Capistrano | |
require 'sshkit' | |
require 'sshkit/dsl' | |
include SSHKit::DSL | |
# set the identifier used to used to tag our Docker images | |
deploy_tag = ENV['DEPLOY_TAG'] | |
# set the name of the environment we are deploying to (e.g. staging, production, etc.) | |
deploy_env = ENV['DEPLOY_ENV'] || :production |
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
app: | |
# map our application source code, in full, to the application root of our container | |
volumes: | |
- .:/var/www/myapp | |
web: | |
# use whatever volumes are configured for the app container | |
volumes_from: | |
- app |
NewerOlder