version: '2'
services:
  db:
    image: postgres
  cache:
    image: redis
  api:
    build: ./api
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - ./api:/usr/src/app
    volumes_from:
      - bundle
    ports:
      - "3000:3000"
    depends_on:
      - db
      - cache
    environment:
      REDIS_URL: redis://cache:6379
  worker:
    build: ./api
    command: bundle exec sidekiq
    volumes:
      - ./api:/usr/src/app
    volumes_from:
      - bundle
    depends_on:
      - db
  bundle:
    # You may need to run `docker-compose build web` before this works.
    image: alpine
    command: echo "I'm a little data volume, short and stout"
    volumes:
      - /bundle
  web:
    build: ./web
    environment:
      - PORT=3001
    command: yarn start
    volumes:
      - ./web:/usr/src/app
    ports:
      - "3001:3001"

version: '2'
services:
  db:
    image: postgres
  cache:
    image: redis
  api:
    build: ./api
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - ./api:/usr/src/app
    volumes_from:
      - bundle
    ports:
      - "3000:3000"
    depends_on:
      - db
      - cache
    environment:
      REDIS_URL: redis://cache:6379
  worker:
    build: ./api
    command: bundle exec sidekiq
    volumes:
      - ./api:/usr/src/app
    volumes_from:
      - bundle
    depends_on:
      - db
      - cache
    environment:
      REDIS_URL: redis://cache:6379
  bundle:
    # You may need to run `docker-compose build web` before this works.
    image: alpine
    command: echo "I'm a little data volume, short and stout"
    volumes:
      - /bundle
  web:
    build: ./web
    environment:
      - PORT=3001
    command: yarn start
    volumes:
      - ./web:/usr/src/app
    ports:
      - "3001:3001"

Fix configuration of worker service
Fix configuration of worker service
