Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.22 KB

DOCKER.LOCAL.md

File metadata and controls

55 lines (41 loc) · 1.22 KB

Docker local development environment

Setup

Requirements:

docker-sync start
docker-compose build

docker-compose run --rm spring bundle install
docker-compose run --rm spring rails db:prepare

docker-compose up -d
docker-compose ps

If all containers are "Up", visit http://localhost:3000 to check if the application is running

Usage

Run all commands through the Spring container. Examples:

docker-compose exec spring spring rspec
docker-compose exec spring spring rake db:migrate
docker-compose exec spring bash

Recommended Zsh aliases

https://github.com/akarzim/zsh-docker-aliases

# Docker
alias dksyn='docker-sync'
alias dksynr='dksyn stop && dksyn start'
alias down='dkcd; dksyn clean'
alias ds='dkce spring'
alias dsd='dkce --env RAILS_ENV=development spring'
alias dst='dkce --env RAILS_ENV=test spring'
alias start='dksyn start &; dkcU &; wait'
alias stop='dksyn stop &; dkcx &; wait'
alias up='dksyn start; dkcU'

# Rails in Docker
alias bundle='ds ./bin/bundle'
alias rails='ds ./bin/rails'
alias rake='ds ./bin/rake'
alias rspec='ds ./bin/rspec'