Update: laravel 8 to 12, php 7.3 to php 8.3, Jenkinsfile, Unit/Feature testing, vapor, docker

This commit is contained in:
Dillon Ngo
2026-04-03 06:59:39 +08:00
parent 58de1017d7
commit b34b7c19d6
142 changed files with 3334 additions and 1101 deletions
+37 -19
View File
@@ -1,12 +1,10 @@
FROM php:7.4-fpm
FROM php:8.3-fpm
WORKDIR /var/www/html
RUN pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug
RUN docker-php-ext-install pdo pdo_mysql
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
@@ -15,25 +13,45 @@ RUN apt-get update && apt-get install -y \
cron \
supervisor \
nano \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& rm -rf /var/lib/apt/lists/*
# Install Xdebug (compatible with PHP 8.3)
RUN pecl install xdebug && docker-php-ext-enable xdebug
# Install PHP extensions
RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip \
&& docker-php-ext-install bcmath
&& docker-php-ext-install zip \
&& docker-php-ext-install bcmath
COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
#NODEJS & NPM
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get -y install nodejs
#NODEJS & NPM (OLD Before upgrade)
# RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# RUN apt-get -y install nodejs
RUN chown -R www-data:www-data /var/www
RUN chmod 755 /var/www
#NODEJS & NPM (Node 14 for x86_64 (amd64))
# RUN curl -fsSL https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.xz -o node.tar.xz \
# && tar -xJf node.tar.xz -C /usr/local --strip-components=1 \
# && rm node.tar.xz
# Configure xdebug
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9002" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# NODEJS & NPM (Node 14 for ARM64)
RUN curl -fsSL https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-arm64.tar.xz -o node.tar.xz \
&& tar -xJf node.tar.xz -C /usr/local --strip-components=1 \
&& rm node.tar.xz
# Set permissions
RUN chown -R www-data:www-data /var/www \
&& chmod 755 /var/www
# Configure Xdebug
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.client_port=9002" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey=VSCODE" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Moved to docker-setup folder
+7 -7
View File
@@ -1,13 +1,13 @@
version: '3'
networks:
exchange-staging:
exchange-development:
services:
#################################################################
nginx:
image: nginx:stable-alpine
container_name: exchange-ngnix
container_name: exchange-2-ngnix
ports:
- "8082:80"
volumes:
@@ -17,11 +17,11 @@ services:
- php
- mysql
networks:
- exchange-staging
- exchange-development
#################################################################
mysql:
image: mysql:5.7.29
container_name: exchange-mysql
container_name: exchange-2-mysql
restart: unless-stopped
tty: true
ports:
@@ -36,20 +36,20 @@ services:
volumes:
- mysql-data:/var/lib/mysql
networks:
- exchange-staging
- exchange-development
#################################################################
php:
build:
context: .
dockerfile: Dockerfile
container_name: exchange-php
container_name: exchange-2-php
volumes:
- ../:/var/www/html
- ./php/default.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
ports:
- "9002:9000"
networks:
- exchange-staging
- exchange-development
#################################################################
volumes: