From 07e01be933344d6f5c8d2497ed7a993fcbe27053 Mon Sep 17 00:00:00 2001 From: Olayiwolaaa Date: Wed, 17 Jun 2026 20:45:29 +0100 Subject: [PATCH] chore: fix Docker build context and dev environment setup - Change build context to repo root, update COPY paths in Dockerfile - Mount repo root as volume for live reloading in dev - Upgrade MySQL 5.7 to 8.0 (5.7 has no ARM image, EOL since Oct 2023) - Add platform: linux/amd64 for cross-architecture compatibility - Add MySQL root password and database environment config --- .docker/docker-compose.yml | 15 +++++++++++---- .docker/php/Dockerfile | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 2e89b0e9..f2cb4983 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -1,6 +1,7 @@ services: web: image: nginx:latest + platform: linux/amd64 ports: - "80:80" volumes: @@ -9,9 +10,15 @@ services: - app app: build: - context: . - dockerfile: ./php/Dockerfile + context: .. + dockerfile: .docker/php/Dockerfile + volumes: + - ..:/var/www/html db: - image: mysql:5.7 + image: mysql:8.0 + platform: linux/amd64 volumes: - - ./mysql:/var/lib/mysql \ No newline at end of file + - ./mysql:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: flutterwave \ No newline at end of file diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 0b11c166..a8b774d6 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -23,13 +23,13 @@ COPY --from=composer:2.4 /usr/bin/composer /usr/bin/composer # This is enough to take advantage of docker cache and composer install will # be executed only when composer.json or composer.lock have indeed changed!- # https://medium.com/@softius/faster-docker-builds-with-composer-install-b4d2b15d0fff -COPY ./app/composer.* ./ +COPY composer.* ./ # install RUN composer install --prefer-dist --no-dev --no-scripts --no-progress --no-interaction # copy application files to the working directory -COPY ./app . +COPY . . # run composer dump-autoload --optimize RUN composer dump-autoload --optimize @@ -45,7 +45,7 @@ FROM app as app_dev ENV XDEBUG_MODE=off # Copy xdebug config file into container -COPY ./php/conf.d/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini +COPY .docker/php/conf.d/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini # Install xdebug RUN set -eux; \