Skip to content

Instantly share code, notes, and snippets.

@cinkagan
Created March 20, 2020 19:47
Show Gist options
  • Save cinkagan/d02e4e28f472ad8928e3de48b7924f25 to your computer and use it in GitHub Desktop.
Save cinkagan/d02e4e28f472ad8928e3de48b7924f25 to your computer and use it in GitHub Desktop.
Php + MySql+ Phpmyadmin docker-compose
version: '3'
services:
web:
build: ./web
container_name: projePhp
depends_on:
- database
volumes:
- ./web:/var/www/html/
ports:
- 8000:80
database:
container_name: projeDatabase
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- ./db/proje.sql:/docker-entrypoint-initdb.d/proje.sql // db klasörü altında bir sql mevcutsa (başlangıç kurulumu için)
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: proje
MYSQL_USER: proje
MYSQL_PASSWORD: root
ports:
- 6033:3306
healthcheck:
test: ["CMD","/usr/bin/mysql", "--user=proje", "--password=root", "--execute", "\"SHOW DATABASES;\""]
interval: 30s
timeout: 10s
retries: 5
phpmyadmin:
container_name: projePma
image: phpmyadmin/phpmyadmin
environment:
MYSQL_USER: root
MYSQL_PASSWORD: root
PMA_HOST: database
ports:
- "8004:80"
links:
- database
depends_on:
- database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment