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
Fish shell didn't play well with Docker Quickstart Terminal at first, this seems to solve the problem. | |
Create a shell script named dockerup (chmod +x dockerup) and place it in /usr/bin/ | |
To initialize the Docker terminal, you can "dockerup". | |
✘ 07:46 ~ cat /usr/bin/dockerup | |
#! /usr/local/bin/fish | |
sh '/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh' |
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
# Adding a GitHub repo to CircleCI | |
curl -s "https://circleci.com/api/v1/project/{{ORGANISATION}}/{{REPO_NAME}}/follow?circle-token={{TOKEN}}" -H "Accept: application/json" -H "Content-type: application/json" -X POST | |
# Adding private key to CircleCI to enable deployment | |
curl -s -H "Content-Type: application/json" --data "{"hostname":"{{HOSTNAME}}","private_key":"{{PRIVATE KEY}}"}" "https://circleci.com/api/v1/project/{{ORGANISATION}}/{{REPO_NAME}}/ssh-key?circle-token={{TOKEN}}" |
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
# Use an official, light-weight Ruby image | |
FROM ruby:2.2.3-slim | |
# Install essential Linux packages (use one RUN command to reduce layer complexity) | |
# IF YOU NEED ImageMagick, ADD THESE TO THE END OF THE LINE BELOW: libmagickwand-dev imagemagick | |
# IF YOU NEED MySQL, ADD THESE TO THE LINE BELOW: mysql-server mysql-client libmysqlclient-dev | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client | |
# IF YOU NEED PostgreSQL, uncomment the line below: |
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
# service configuration for our dockerized Rails app | |
app: | |
# use the Dockerfile next to this file | |
build: . | |
# sources environment variable configuration for our app | |
env_file: .env | |
# rely on the RAILS_ENV value of the host machine | |
environment: | |
RAILS_ENV: $RAILS_ENV | |
# makes the app container aware of the DB container |
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
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 |
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
# 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 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 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 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 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 |
OlderNewer