app:
    build: app
    ports:
        - "81:4567"
    links:
        - db
    environment:
        RACK_ENV: production

db:
    build: db
    ports:
        - "28080:8080"
        - "38015:28015"
        - "39015:29015"

web:
    build: web
    ports:
        - "80:4000"
    links:
        - app

app:
    build: app
    ports:
        - "82:4567"
    links:
        - db
    environment:
        RACK_ENV: production

db:
    build: db
    ports:
        - "28080:8080"
        - "38015:28015"
        - "39015:29015"

web:
    build: web
    ports:
        - "81:4000"
    links:
        - app

Use non-conflicting ports for web and app
Use non-conflicting ports for web and app
