Skip to content

Commit

Permalink
Merge pull request #56 from Aeliot-Tm/update-docker
Browse files Browse the repository at this point in the history
Update build of docker container
  • Loading branch information
Aeliot-Tm authored Nov 29, 2024
2 parents 9a861d7 + 0e347e7 commit 30f3333
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 49 deletions.
42 changes: 42 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG PHP_VERSION=8.2.7
ARG DEBIAN_RELEASE=bullseye

FROM php:${PHP_VERSION}-cli-${DEBIAN_RELEASE}

ARG COMPOSER_ALLOW_SUPERUSER=1
ARG COMPOSER_NO_INTERACTION=1
ARG COMPOSER_VERSION=2.7.6
ARG DEBIAN_FRONTEND=noninteractive
ARG DOCKER_PHP_DEPS='libxml2-dev libzip-dev unzip'
ARG XDEBUG_VERSION=3.2.1

RUN set -xe; \
apt-get --allow-releaseinfo-change update && \
apt-get install -y -qq ${DOCKER_PHP_DEPS} --no-install-suggests --no-install-recommends && \
docker-php-ext-install -j$(nproc) xml && \
docker-php-ext-install -j$(nproc) zip && \
pecl install xdebug-${XDEBUG_VERSION} && docker-php-ext-enable xdebug && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

COPY .docker/php/conf.d/*.ini /usr/local/etc/php/conf.d/

# Memory limit
RUN echo "memory_limit = 1G" >> /usr/local/etc/php/php.ini

# Install composer
RUN set -xe; \
curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} > /dev/null 2>&1 && \
chmod +x /usr/local/bin/composer

WORKDIR /app

COPY composer.* ./

RUN set -xe; \
composer install --no-autoloader --no-dev --no-interaction --no-progress --no-scripts --no-suggest --prefer-dist && \
composer clear-cache && \
rm -rf ./vendor/*/*/tests

COPY ./ ./
RUN composer dump-autoload
11 changes: 11 additions & 0 deletions .docker/php/conf.d/docker-php-ext-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[xdebug]
zend_extension=xdebug.so

xdebug.mode=coverage,debug
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
xdebug.discover_client_host=true
xdebug.start_with_request=yes
xdebug.idekey=PHPSTORM
xdebug.log_level=0
xdebug.log=/app/var/xdebug.log
33 changes: 0 additions & 33 deletions Dockerfile

This file was deleted.

10 changes: 10 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
php:
build:
context: .
dockerfile: .docker/php/Dockerfile
restart: on-failure
ports:
- "9003:9003"
volumes:
- ./:/app
16 changes: 0 additions & 16 deletions docker-compose.yml

This file was deleted.

0 comments on commit 30f3333

Please sign in to comment.