2016-11-29 19:23:18 +00:00
|
|
|
version: '2'
|
|
|
|
|
|
|
|
# Quickstart:
|
2017-04-13 14:44:35 +00:00
|
|
|
# docker-compose up -d web
|
|
|
|
# docker-compose run --rm db_init
|
2016-11-29 19:23:18 +00:00
|
|
|
|
|
|
|
# To cleanup:
|
2017-04-13 14:44:35 +00:00
|
|
|
# docker-compose stop && docker-compose rm
|
2016-11-29 19:23:18 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
2017-04-13 14:44:35 +00:00
|
|
|
container_name: asciinema_postgres
|
2017-04-13 13:56:37 +00:00
|
|
|
|
2016-11-29 19:23:18 +00:00
|
|
|
redis:
|
|
|
|
image: redis
|
2017-04-13 14:44:35 +00:00
|
|
|
container_name: asciinema_redis
|
2017-04-13 13:56:37 +00:00
|
|
|
|
2016-11-29 19:23:18 +00:00
|
|
|
sidekiq:
|
|
|
|
image: asciinema/asciinema.org
|
2017-04-13 14:44:35 +00:00
|
|
|
container_name: asciinema_worker
|
2016-11-29 19:23:18 +00:00
|
|
|
links:
|
|
|
|
- redis
|
|
|
|
- postgres
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
|
|
|
|
REDIS_URL: "redis://redis:6379"
|
|
|
|
HOST: "localhost:3000"
|
|
|
|
command: "ruby start_sidekiq.rb"
|
|
|
|
volumes:
|
|
|
|
- /tmp/asciinema/uploads:/app/uploads
|
|
|
|
|
2017-04-13 14:44:35 +00:00
|
|
|
web:
|
2016-11-29 19:23:18 +00:00
|
|
|
image: asciinema/asciinema.org
|
2017-04-13 14:44:35 +00:00
|
|
|
container_name: asciinema_web
|
2016-11-29 19:23:18 +00:00
|
|
|
links:
|
|
|
|
- redis
|
|
|
|
- postgres
|
|
|
|
depends_on:
|
|
|
|
- sidekiq
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
|
|
|
|
REDIS_URL: "redis://redis:6379"
|
|
|
|
HOST: "localhost:3000" # replace with actual hostname/ip.... ${HOSTNAME} doesn't seem to work..
|
|
|
|
ports:
|
2017-04-13 13:56:50 +00:00
|
|
|
- "3000:80"
|
2016-11-29 19:23:18 +00:00
|
|
|
volumes:
|
|
|
|
- /tmp/asciinema/uploads:/app/uploads
|
|
|
|
|
|
|
|
db_init:
|
|
|
|
image: asciinema/asciinema.org
|
|
|
|
links:
|
|
|
|
- postgres
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
|
|
|
|
command: "bundle exec rake db:setup"
|