services: web: image: php:8.4-apache #check the php version you need for your project container_name: lamp-web #ports: # - "8086:80" #this line maps your pc port to the container port depends_on: - db #this line links this container to the db container volumes: - /srv/docker/lamp-stack/html:/var/www/html #this line maps the content of ./html in your pc to the /var/www/html of the container restart: unless-stopped db: image: mysql:9.3.0 #check the mysql version you need for your project container_name: lamp-db environment: MYSQL_ROOT_PASSWORD: password #you can change the mysql root password here MYSQL_DATABASE: lamp_db #you can change the database name here volumes: - /srv/docker/lamp-stack/mysql_data:/var/lib/mysql #this line maps the content of ./mysql_data in your pc to the /var/lib/mysql of the container restart: unless-stopped phpmyadmin: image: phpmyadmin/phpmyadmin container_name: lamp-phpadmin #ports: # - "8087:80" #this line maps your pc port to the container port depends_on: - db #this line links this container to the db container environment: PMA_HOST: db restart: unless-stopped networks: default: external: true name: nginx