Download docker-compose.override.yml
shown below to your project's directory.
If you prefer you can edit the existing docker-compose.yml
.
Add a new service:
services:
...
phpmyadmin:
image: 'phpmyadmin:5'
ports:
- '${FORWARD_PHPMYADMIN_PORT:-8888}:80'
environment:
PMA_HOST: 'mysql'
PMA_USER: '${DB_USERNAME}'
PMA_PASSWORD: '${DB_PASSWORD}'
PMA_ABSOLUTE_URI: 'http://localhost:${FORWARD_PHPMYADMIN_PORT:-8888}/'
volumes:
- 'sailphpmyadmin:/sessions'
networks:
- sail
Add a new volume to store the session state:
volumes:
...
sailphpmyadmin:
driver: local
After running sail up
, phpMyAdmin will be available at http://localhost:8888/. The port may be changed by setting the FORWARD_PHPMYADMIN_PORT
environment variable.