30 lines
581 B
YAML
30 lines
581 B
YAML
|
version: '3'
|
||
|
|
||
|
services:
|
||
|
db:
|
||
|
build:
|
||
|
context: ./sql
|
||
|
ports:
|
||
|
- "5455:3306"
|
||
|
volumes:
|
||
|
- "db-data:/var/lib/mysql"
|
||
|
environment:
|
||
|
MYSQL_ROOT_PASSWORD: "Test"
|
||
|
|
||
|
webserver:
|
||
|
build:
|
||
|
context: .
|
||
|
ports:
|
||
|
- "80:80"
|
||
|
volumes:
|
||
|
- "./:/var/www/html"
|
||
|
depends_on:
|
||
|
- db
|
||
|
|
||
|
volumes:
|
||
|
db-data:
|
||
|
|
||
|
|
||
|
# docker run -d -p 5455:3306 -v `pwd`/setup:/docker-entrypoint-initdb.d/ -v `pwd`/mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Test mariadb
|
||
|
# docker run -d -p 80:80 --name my-apache-php-app -v `pwd`:/var/www/html php:7.0-apache
|