version: '3.1' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: regformdata MYSQL_USER: example MYSQL_PASSWORD: example ports: - "3306:3306" volumes: - db_data:/var/lib/mysql php: build: context: . dockerfile: Dockerfile restart: always ports: - "80:80" phpmyadmin: image: phpmyadmin/phpmyadmin restart: always environment: PMA_HOST: db MYSQL_ROOT_PASSWORD: example ports: - "8080:80" depends_on: - db volumes: db_data: