asciinema.org/docker-compose.yml
2017-04-15 18:15:52 +02:00

78 lines
1.9 KiB
YAML

version: '2'
# Quickstart:
# docker-compose run --rm db_init
# docker-compose up -d web
# To cleanup:
# docker-compose stop && docker-compose rm
services:
postgres:
image: postgres
container_name: asciinema_postgres
environment:
POSTGRES_USER: "asciinema"
POSTGRES_PASSWORD: "sekrit"
# see https://hub.docker.com/_/postgres/ for more configuration options
# for this image
redis:
image: redis
container_name: asciinema_redis
# see https://hub.docker.com/_/redis/ for more configuration options
# for this image
sidekiq:
image: asciinema/asciinema.org
container_name: asciinema_worker
links:
- redis
- postgres
- smtp
environment:
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
HOST: "localhost:3000"
command: "bundle exec sidekiq"
volumes:
- /tmp/asciinema/uploads:/app/uploads
smtp:
image: namshi/smtp
container_name: asciinema_smtp
environment:
MAILNAME: "localhost"
# see https://github.com/namshi/docker-smtp for more SMTP configuration options
# for this image
web:
image: asciinema/asciinema.org
container_name: asciinema_web
links:
- redis
- postgres
- smtp
depends_on:
- sidekiq
environment:
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
HOST: "localhost:3000" # replace with actual hostname/ip.... ${HOSTNAME} doesn't seem to work..
ports:
- "3000:80"
volumes:
- /tmp/asciinema/uploads:/app/uploads
db_init:
image: asciinema/asciinema.org
links:
- redis
- postgres
environment:
DATABASE_URL: "postgresql://asciinema:sekrit@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
command: "bundle exec rake db:setup"
volumes:
- /tmp/asciinema/uploads:/app/uploads