diff --git a/docker-compose.yml b/docker-compose.yml index 767ec9d9..ff8d953c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: php: - # image: 'php:7.2-fpm' + # Latest stable at last update: 'php:8.5.0-fpm-alpine' build: context: ./docker dockerfile: php.Dockerfile @@ -12,7 +12,9 @@ services: - mariadb nginx: - image: nginx:latest + # Latest stable at last update. You can also use nginx:latest to auto-update, + # or nginx:latest-alpine to auto-update with a smaller image size (but no bash). + image: nginx:1.29.4-alpine container_name: ${APP_NAME:?err}-nginx ports: - '80:80' @@ -24,10 +26,11 @@ services: - './config/nginx:/etc/nginx/conf.d' mariadb: - image: mariadb:10.3.9 + # Latest LTS at last update. You can also use mariadb:lts to auto-update. + image: mariadb:11.8.5 container_name: ${APP_NAME:?err}-mariadb restart: 'on-failure' environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?err} volumes: - - ${PWD} + - './mysql:/var/lib/mysql' diff --git a/docker/php.Dockerfile b/docker/php.Dockerfile deleted file mode 100644 index b1fd735d..00000000 --- a/docker/php.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM php:7.2-fpm - -RUN apt-get update && \ - apt-get install -y git zip - -RUN curl --silent --show-error https://getcomposer.org/installer | php && \ - mv composer.phar /usr/local/bin/composer - -# Uncomment to have mysqli extension installed and enabled -# RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli diff --git a/mysql/.gitignore b/mysql/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/mysql/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/php-docker/php.Dockerfile b/php-docker/php.Dockerfile new file mode 100644 index 00000000..fa57b627 --- /dev/null +++ b/php-docker/php.Dockerfile @@ -0,0 +1,17 @@ +# Latest stable at last update. You can also use php:fpm to auto-update, +# or php:fpm-alpine to auto-update with a smaller image size (but no bash). +FROM php:8.5.0-fpm-alpine + +# Install git and zip +RUN apt-get update && \ + apt-get install -y git zip unzip + +# PIE is used for installing extensions. Composer is used for dependency management. +RUN curl --silent --show-error https://github.com/php/pie/releases/download/1.3.2/pie.phar | php && \ + mv pie.phar /usr/local/bin/pie + +RUN curl --silent --show-error https://getcomposer.org/installer | php && \ + mv composer.phar /usr/local/bin/composer + +# Uncomment to have mysqli extension installed and enabled +# RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli