version: '3.3' services: mysql: image: mysql:latest restart: always volumes: - database:/var/lib/mysql environment: MYSQL_DATABASE: 'db' MYSQL_USER: 'user' MYSQL_PASSWORD: 'password' MYSQL_ROOT_PASSWORD: 'rootPassword' ports: - 3306:3306 app: build: context: ./docker dockerfile: php-fpm.docker volumes: - "./public/:/app/public" - "./src/:/app/src" depends_on: - mysql nginx: build: context: ./docker dockerfile: nginx.docker volumes: - "./public/:/app/public" ports: - 80:80 depends_on: - app volumes: database: