Created
February 9, 2021 02:37
-
-
Save supakornkim/6d206eb1e0e947d512d1bd8fb92d456f to your computer and use it in GitHub Desktop.
docker-compose for php-apache mysql phpmyadmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.1" | |
services: | |
www: | |
build: . | |
restart: always | |
ports: | |
- "8100:80" | |
volumes: | |
- ./app:/var/www/html/ | |
links: | |
- db | |
db: | |
image: mysql:8.0 | |
restart: always | |
ports: | |
- "3306:3306" | |
command: --default-authentication-plugin=mysql_native_password | |
environment: | |
MYSQL_DATABASE: myDb | |
MYSQL_USER: user | |
MYSQL_PASSWORD: test | |
MYSQL_ROOT_PASSWORD: test | |
volumes: | |
- ./dump:/docker-entrypoint-initdb.d | |
- ./conf:/etc/mysql/conf.d | |
- persistent:/var/lib/mysql | |
phpmyadmin: | |
image: phpmyadmin/phpmyadmin | |
restart: always | |
links: | |
- db:db | |
ports: | |
- 8101:80 | |
environment: | |
MYSQL_USER: user | |
MYSQL_PASSWORD: test | |
MYSQL_ROOT_PASSWORD: test | |
networks: | |
default: | |
external: | |
name: nginx-proxy | |
volumes: | |
persistent: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment