Skip to content
Snippets Groups Projects
docker-compose.yml 1.43 KiB
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
version: '2'
networks:
  lb_web:
    external: true
  back:
    driver: bridge
services:
  db:
    restart: always
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: postgres:9.6-alpine
Pierre Ozoux's avatar
Pierre Ozoux committed
    networks:
    - back
Pierre Ozoux's avatar
Pierre Ozoux committed
    volumes:
    - ./data/postgres:/var/lib/postgresql/data
Pierre Ozoux's avatar
Pierre Ozoux committed
  redis:
    restart: always
    image: redis:alpine
    networks:
    - back
  web:
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: nginx:alpine
Pierre Ozoux's avatar
Pierre Ozoux committed
    volumes:
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./nginx.conf:/etc/nginx/nginx.conf
Pierre Ozoux's avatar
Pierre Ozoux committed
    volumes_from:
    - app
    depends_on:
    - app
    - streaming
    networks:
    - back
    - lb_web
Pierre Ozoux's avatar
Pierre Ozoux committed
    environment:
Pierre Ozoux's avatar
Pierre Ozoux committed
    - VIRTUAL_HOST
  app:
    restart: always
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: gargron/mastodon:v2.3.3
Pierre Ozoux's avatar
Pierre Ozoux committed
    env_file: .env.production
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    depends_on:
    - db
    - redis
    volumes:
    - ./public/assets:/mastodon/public/assets
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./public/packs:/mastodon/public/packs
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./public/system:/mastodon/public/system
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./tmp:/mastodon/tmp
Pierre Ozoux's avatar
Pierre Ozoux committed
    networks:
    - back
  streaming:
    restart: always
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: gargron/mastodon:v2.3.3
Pierre Ozoux's avatar
Pierre Ozoux committed
    env_file: .env.production
    command: npm run start
    depends_on:
    - db
    - redis
    networks:
    - back
  sidekiq:
    restart: always
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: gargron/mastodon:v2.3.3
Pierre Ozoux's avatar
Pierre Ozoux committed
    env_file: .env.production
    command: bundle exec sidekiq -q default -q mailers -q pull -q push
    depends_on:
    - db
    - redis
    volumes:
    - ./public/system:/mastodon/public/system
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./public/packs:/mastodon/public/packs
Pierre Ozoux's avatar
Pierre Ozoux committed
    - ./tmp:/mastodon/tmp
Pierre Ozoux's avatar
Pierre Ozoux committed
    networks:
    - back