2026-04-12 01:25:57 +00:00
|
|
|
services:
|
|
|
|
|
web:
|
|
|
|
|
image: php:8.4-apache #check the php version you need for your project
|
2026-04-12 01:42:51 +00:00
|
|
|
#container_name: lamp-web
|
2026-04-12 01:25:57 +00:00
|
|
|
#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
|
2026-04-12 01:41:28 +00:00
|
|
|
container_name: lamp-db
|
2026-04-12 01:25:57 +00:00
|
|
|
environment:
|
2026-04-12 01:39:15 +00:00
|
|
|
MYSQL_ROOT_PASSWORD: ${PASSWORD} #you can change the mysql root password here
|
2026-04-12 01:25:57 +00:00
|
|
|
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
|
2026-04-12 01:43:23 +00:00
|
|
|
container_name: lamp-phpadmin
|
2026-04-12 01:25:57 +00:00
|
|
|
#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
|