version: '3.7' services: db: image: 'mysql:8.0.29' restart: always environment: MYSQL_DATABASE: 'myapp_development' MYSQL_USER: 'cheese' MYSQL_PASSWORD: '111' MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_INITDB_SKIP_TZINFO: 1 ports: - '3307:3306' volumes: - 'my-db:/var/lib/mysql' container_name: db web: build: . command: bundle exec rails s -p 3000 -b 0.0.0.0 volumes: - web-app:/myapp ports: - "3000:3000" depends_on: - db restart: always volumes: my-db: {} web-app: {}