Skip to content

Instantly share code, notes, and snippets.

@soup-bowl
Last active September 7, 2022 21:09
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save soup-bowl/f3880a446ea27f2088b4243d3e8f2c65 to your computer and use it in GitHub Desktop.
Save soup-bowl/f3880a446ea27f2088b4243d3e8f2c65 to your computer and use it in GitHub Desktop.
Docker-compose LAMP dev stack
version: '3.6'
services:
db:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: e9w86036f78sd9
volumes:
- "./database:/var/lib/mysql"
db_pma:
image: phpmyadmin/phpmyadmin:latest
depends_on:
- db
ports:
- 8082:80
environment:
MYSQL_ROOT_PASSWORD: e9w86036f78sd9
PMA_USER: root
PMA_PASSWORD: e9w86036f78sd9
mail:
image: mailhog/mailhog:latest
ports:
- 8081:8025
www:
depends_on:
- db
- mail
image: php:apache
volumes:
- "./www:/var/www/html"
ports:
- 8080:80
@8lafuan8
Copy link

8lafuan8 commented Jan 7, 2022

"You don't have permission to access this resource." on port 8080, what can i do? Thank you

@soup-bowl
Copy link
Author

Common cause is the www directory is empty. When you run this script first time (docker-compose up) it creates a db and www directory. You need to put the PHP script(s) in the www directory, then it will be accessible on the Apache instance (8080).

More complex causes will be permissions-related, which can unfortunately vary per operating system and CMS setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment