diff --git a/docker-compose.yml b/docker-compose.yml index cf826f1..d50166b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,31 @@ services: app_net: ipv4_address: 172.16.1.40 + MYSQL: + hostname: docker-mysql + image: mysql:5.7 + ports: + - 3306:3306 + command: --default-authentication-plugin=mysql_native_password + volumes: + - ./Database/mysql:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + command: mysqld --sql_mode="" --character-set-server=utf8 --init-connect='SET NAMES UTF8;' + deploy: + resources: + limits: + cpus: '0.50' + memory: 512M + reservations: + memory: 256M + restart_policy: + condition: on-failure + networks: + - app_net + NGINX: hostname: docker-nginx build: @@ -69,6 +94,7 @@ services: - ${VOLUMES_DRIVER}:/var/www depends_on: - FPM + - MYSQL restart: on-failure extra_hosts: - "localhost:172.16.1.50" diff --git a/env-example b/env-example index b8d126c..10c363e 100644 --- a/env-example +++ b/env-example @@ -4,3 +4,10 @@ # e.g. /Users/USER_NAME/Projects VOLUMES_DRIVER= + + + +# mysql +MYSQL_ROOT_PASSWORD= +MYSQL_USER= +MYSQL_PASSWORD= diff --git a/phpWrapper b/phpWrapper index 637aba0..2e4bef2 100755 --- a/phpWrapper +++ b/phpWrapper @@ -11,4 +11,4 @@ fi docker run --rm -i \ -v $VOLUMES_DRIVER:/var/www \ - cscolabear/7.3-fpm:0.1 php "$@" + cscolabear/7.3-fpm:0.1 "$@"