Skip to content

Instantly share code, notes, and snippets.

@supakornkim
Created February 9, 2021 02:37
Show Gist options
  • Save supakornkim/6d206eb1e0e947d512d1bd8fb92d456f to your computer and use it in GitHub Desktop.
Save supakornkim/6d206eb1e0e947d512d1bd8fb92d456f to your computer and use it in GitHub Desktop.
docker-compose for php-apache mysql phpmyadmin
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