services:
  db:
    image: registry.opensuse.org/obs/server/unstable/containers/containers/openbuildservice/mariadb
    ports:
      - "3306:3306"
    command: /usr/lib/mysql/mysql-systemd-helper start
  cache:
    image: registry.opensuse.org/obs/server/unstable/containers/containers/openbuildservice/memcached
    ports:
      - "11211:11211"
    command: /usr/bin/memcached -u memcached
  backend:
    image: registry.opensuse.org/obs/server/unstable/containers/containers/openbuildservice/backend
    volumes:
      - .:/obs:z
    command: /obs/contrib/start_development_backend -d /obs
  worker:
    image: registry.opensuse.org/obs/server/unstable/containers/containers/openbuildservice/backend
    volumes:
      - .:/obs:z
    privileged: true
    depends_on:
      - backend
    command: /obs/contrib/start_development_worker
  frontend:
    image: openbuildservice/frontend
    command: foreman start -p 3000
    build:
      dockerfile: docker-files/Dockerfile
      context: src/api
      args:
        CONTAINER_USERID: 1000
    volumes:
      - .:/obs:z
    ports:
      - "3000:3000"
      - "1080:1080"
    depends_on:
      - db
      - cache
      - backend
      - worker
