Avoid using volumes for static content for jenkins

helpers/ci-integration
Nicolas Arenas 2024-09-25 18:28:46 +02:00
parent 5f6e2e8610
commit 77ef4aca3f
2 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,49 @@
services:
database:
container_name: ogcore-database
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ogcore
MYSQL_PASSWORD: root
MYSQL_USER: admin
ports:
- 3336:3306
volumes:
- database_data:/var/lib/mysql
networks:
- ogcore-network
nginx:
container_name: ogcore-nginx
build:
context: .
dockerfile: ./docker/Dockerfile-nginx
depends_on:
- php
ports:
- 8080:80
volumes:
- ./public:/var/www/html/public:cached
networks:
- ogcore-network
php:
container_name: ogcore-php
build:
context: .
dockerfile: ./docker/Dockerfile-jenkins-php
depends_on:
- database
environment:
XDEBUG_CLIENT_HOST: 127.17.0.1
XDEBUG_CLIENT_PORT: 9003
PHP_IDE_CONFIG: serverName=ogcore
networks:
- ogcore-network
volumes:
database_data:
networks:
ogcore-network:

View File

@ -0,0 +1,31 @@
FROM php:8.3-fpm-alpine
ENV COMPOSER_ALLOW_SUPERUSER=1
# Install PHP extensions
RUN docker-php-ext-install pdo mysqli pdo_mysql opcache
# Install Zip and more extension
RUN apk add --no-cache bash libzip-dev zip unzip
RUN docker-php-ext-install zip
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer self-update
# Install bash
RUN apk add --no-cache bash git jq moreutils openssh rsync yq
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions
RUN install-php-extensions sockets
# Add xdebug
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
RUN apk add --update linux-headers
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
RUN apk del -f .build-deps
COPY ./docker/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
COPY . /var/www/html