Skip to content
Snippets Groups Projects
docker-compose.yml 1.46 KiB
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
version: '2'
networks:
  lb_web:
    external: true
  back:
    driver: bridge
Pierre Ozoux's avatar
Pierre Ozoux committed
    ipam:
      driver: default
      config:
      - subnet: 10.0.${SUBNET}.0/24
Pierre Ozoux's avatar
Pierre Ozoux committed
services:
  db:
    restart: always
Pierre Ozoux's avatar
Pierre Ozoux committed
    image: postgres:14-alpine
    shm_size: 1g
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
    environment:
    - POSTGRES_PASSWORD
Pierre Ozoux's avatar
Pierre Ozoux committed
  redis:
    restart: always
Hugo Renard's avatar
Hugo Renard committed
    image: redis:7-alpine
Pierre Ozoux's avatar
Pierre Ozoux committed
    networks:
    - back
Hugo Renard's avatar
Hugo Renard committed
    volumes:
      - ./data/redis:/data
Pierre Ozoux's avatar
Pierre Ozoux committed
  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
    - VIRTUAL_PORT=80
Pierre Ozoux's avatar
Pierre Ozoux committed
    - LETSENCRYPT_HOST
Pierre Ozoux's avatar
Pierre Ozoux committed
  app:
    restart: always
    image: ghcr.io/mastodon/mastodon:v4.1.12
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/system:/mastodon/public/system
    networks:
    - back
  streaming:
    restart: always
    image: ghcr.io/mastodon/mastodon:v4.1.12
Pierre Ozoux's avatar
Pierre Ozoux committed
    env_file: .env.production
Pierre Ozoux's avatar
Pierre Ozoux committed
    command: yarn start
Pierre Ozoux's avatar
Pierre Ozoux committed
    depends_on:
    - db
    - redis
    networks:
    - back
  sidekiq:
    restart: always
    image: ghcr.io/mastodon/mastodon:v4.1.12
Pierre Ozoux's avatar
Pierre Ozoux committed
    env_file: .env.production
Pierre Ozoux's avatar
Pierre Ozoux committed
    command: bundle exec sidekiq
Pierre Ozoux's avatar
Pierre Ozoux committed
    depends_on:
    - db
    - redis
    volumes:
    - ./public/system:/mastodon/public/system
    networks:
    - back