This is a Squadster deployment repo.
It uses Docker Swarm and Capistrano for deployment.
Check out API repo for more information about application and GitHub Registry for images overview.
Your target instance should have Docker with initialized Swarm.
You cat run ./bin/create_machine.sh
to configure docker-machine, install docker on the server and enable
the swarm mode there.
All you need to do is copy default local environment and database settings:
cp .env.sample .env.production
cp .env.sample .env.staging
cp .env.sample .env.local
cp .env.db.sample .env.db
Then configure missing values and it's ready to go!
Run cap <stage> deploy
to deliver build files to the target instance and launch/update swarm there.
Availavle stages are production
, staging
and local
. The last one will run everything locally.
If you need to manually rebuild and push the nginx image use ./bin/build_nginx.sh
, it will also build it on Travis.
There are several tasks to simplify application access
- To connect to the instance via SSH
cap <stage> access::ssh
. - To run iex shell on the server run
cap <stage> api:iex
. - To connect directly to the database run
cap <stage> db:psql
.