2016-11-29 19:23:18 +00:00
|
|
|
version: '2'
|
|
|
|
|
|
|
|
# Quickstart:
|
2017-04-15 16:15:52 +00:00
|
|
|
# docker-compose run --rm db_init
|
2017-04-13 14:44:35 +00:00
|
|
|
# docker-compose up -d web
|
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-14 22:01:31 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: "asciinema"
|
|
|
|
POSTGRES_PASSWORD: "sekrit"
|
2017-04-15 19:24:51 +00:00
|
|
|
|
|
|
|
### Uncomment to enable DB persistence
|
|
|
|
# volumes:
|
|
|
|
# - ./postgres:/var/lib/postgresql/data
|
|
|
|
|
|
|
|
### See https://hub.docker.com/_/postgres/ for more
|
|
|
|
### configuration options for this image.
|
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-15 19:24:51 +00:00
|
|
|
|
|
|
|
### Uncomment to enable Redis persistence
|
|
|
|
# volumes:
|
|
|
|
# - ./redis:/data
|
|
|
|
|
|
|
|
### See https://hub.docker.com/_/redis/ for more
|
|
|
|
### configuration options for this image.
|
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
|
2017-04-13 20:19:39 +00:00
|
|
|
- smtp
|
2016-11-29 19:23:18 +00:00
|
|
|
environment:
|
2017-04-14 22:01:31 +00:00
|
|
|
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
|
2016-11-29 19:23:18 +00:00
|
|
|
REDIS_URL: "redis://redis:6379"
|
|
|
|
HOST: "localhost:3000"
|
2017-04-13 20:19:39 +00:00
|
|
|
command: "bundle exec sidekiq"
|
2016-11-29 19:23:18 +00:00
|
|
|
volumes:
|
|
|
|
- /tmp/asciinema/uploads:/app/uploads
|
|
|
|
|
2017-04-13 20:19:39 +00:00
|
|
|
smtp:
|
|
|
|
image: namshi/smtp
|
|
|
|
container_name: asciinema_smtp
|
|
|
|
environment:
|
|
|
|
MAILNAME: "localhost"
|
|
|
|
# see https://github.com/namshi/docker-smtp for more SMTP configuration options
|
2017-04-14 22:01:31 +00:00
|
|
|
# for this image
|
2017-04-13 20:19:39 +00:00
|
|
|
|
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
|
2017-04-13 20:19:39 +00:00
|
|
|
- smtp
|
2016-11-29 19:23:18 +00:00
|
|
|
depends_on:
|
|
|
|
- sidekiq
|
|
|
|
environment:
|
2017-04-14 22:01:31 +00:00
|
|
|
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
|
2016-11-29 19:23:18 +00:00
|
|
|
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:
|
2017-04-15 16:15:52 +00:00
|
|
|
- redis
|
2016-11-29 19:23:18 +00:00
|
|
|
- postgres
|
|
|
|
environment:
|
2017-04-14 22:01:31 +00:00
|
|
|
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
|
2017-04-15 16:15:52 +00:00
|
|
|
REDIS_URL: "redis://redis:6379"
|
2016-11-29 19:23:18 +00:00
|
|
|
command: "bundle exec rake db:setup"
|
2017-04-15 16:15:52 +00:00
|
|
|
volumes:
|
|
|
|
- /tmp/asciinema/uploads:/app/uploads
|