Skip to content

Commit c4bbb49

Browse files
#1 Update .docker according to process-bundle one
1 parent 42fbdb3 commit c4bbb49

File tree

9 files changed

+54
-81
lines changed

9 files changed

+54
-81
lines changed

.docker/apache2/conf/apache2.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
SetHandler proxy:fcgi://php:9000
1616
</FilesMatch>
1717

18-
DocumentRoot /var/www/html/public
19-
<Directory /var/www/html/public>
18+
DocumentRoot /var/www/public
19+
<Directory /var/www/public>
2020
AllowOverride None
2121
Require all granted
2222
FallbackResource /index.php

.docker/docker-compose.yml renamed to .docker/compose.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
x-base-php: &base-php
22
build:
3-
context: ./php
3+
context: php
44
args:
55
UID: ${UID:-1000}
66
GID: ${GID:-1000}
77
PHP_VERSION: ${PHP_VERSION:-8.2}
88
XDEBUG_VERSION: ${XDEBUG_VERSION:-3.2.0}
99
env_file: .env
1010
volumes:
11-
- ../:${VOLUME_ROOT:-/var/www/html}
12-
- ./php/ini/symfony.ini:/usr/local/etc/php/conf.d/99-symfony.ini
11+
- ../:/var/www
1312
extra_hosts:
1413
- "host.docker.internal:host-gateway"
1514
environment:
16-
COMPOSER_HOME: ${VOLUME_ROOT:-/var/www/html}/.composer
15+
COMPOSER_HOME: /var/www/.composer
1716
COMPOSER_MEMORY_LIMIT: -1
1817
XDEBUG_MODE: ${XDEBUG_MODE:-off}
1918
PHP_IDE_CONFIG: serverName=sandbox_symfony
2019
XDEBUG_CONFIG: ${XDEBUG_CONFIG:-}
2120

2221
x-base-apache2: &base-apache2
2322
build:
24-
context: ./apache2
23+
context: apache2
2524
args:
2625
UID: ${UID:-1000}
2726
GID: ${GID:-1000}
2827
env_file: .env
2928
volumes:
30-
- ../:${VOLUME_ROOT:-/var/www/html}
29+
- ../:/var/www
3130
- ./apache2/conf/apache2.conf:/etc/apache2/sites-available/000-default.conf
3231
depends_on:
3332
- php

.docker/docker-compose.override.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.docker/php/Dockerfile

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
11
ARG PHP_VERSION=8.2
2-
FROM php:${PHP_VERSION}-fpm AS php
2+
FROM php:${PHP_VERSION}-fpm-alpine AS php
3+
34
ARG XDEBUG_VERSION=3.1.4
45

5-
# Set user and group
6-
ARG UID=1000
7-
ARG GID=1000
8-
RUN usermod --uid ${UID} www-data && \
9-
groupmod --gid ${GID} www-data
6+
ARG UID
7+
ARG GID
108

11-
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
12-
RUN chmod +x /usr/local/bin/install-php-extensions
13-
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash -E
9+
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
10+
COPY /conf.d/ "$PHP_INI_DIR/conf.d/"
1411

15-
# Install packages
16-
RUN apt-get update && apt-get install -y \
12+
RUN apk update && apk add \
13+
tzdata \
14+
shadow \
15+
nano \
16+
bash \
17+
icu-dev \
18+
libxml2-dev \
19+
libzip-dev \
20+
postgresql-dev \
21+
unzip \
1722
wget \
1823
git \
19-
unzip \
20-
libicu-dev \
21-
libzip-dev \
22-
gosu \
23-
symfony-cli \
24-
procps \
2524
&& docker-php-ext-configure intl \
26-
&& install-php-extensions \
27-
intl \
28-
pcntl \
29-
opcache \
30-
zip \
31-
gd \
32-
imagick \
33-
pdo \
34-
pdo_pgsql \
35-
pgsql \
36-
pdo_mysql \
37-
mysqli \
38-
sysvsem
39-
RUN pecl install xdebug-${XDEBUG_VERSION}
40-
## Install composer
41-
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
25+
&& docker-php-ext-install intl soap opcache zip pdo pdo_pgsql pdo_mysql \
26+
&& docker-php-ext-enable soap opcache
27+
28+
RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} \
29+
&& apk add --update linux-headers \
30+
&& pecl install xdebug-${XDEBUG_VERSION} \
31+
&& apk del pcre-dev ${PHPIZE_DEPS}
32+
33+
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime \
34+
&& sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Paris/" $PHP_INI_DIR/php.ini
35+
36+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
37+
38+
RUN usermod -u $UID www-data \
39+
&& groupmod -g $GID www-data
40+
41+
USER www-data:www-data
42+
43+
WORKDIR /var/www
4244

4345
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
44-
RUN chmod +x /usr/local/bin/entrypoint.sh
4546
ENTRYPOINT ["entrypoint.sh"]
4647
CMD ["php-fpm"]

.docker/php/conf.d/dev.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
display_errors = 1
2+
error_reporting = E_ALL
3+
4+
opcache.validate_timestamps = 1
5+
opcache.revalidate_freq = 0
6+
7+
memory_limit=512M
8+
post_max_size = 6M
9+
upload_max_filesize = 5M

.docker/php/entrypoint.sh

100644100755
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ if [[ "${XDEBUG_MODE}" != "off" ]]; then
55
docker-php-ext-enable xdebug
66
fi
77

8-
[ "$1" == 'bin/console' ] || [ "$1" == 'bash' ] || [ "$1" == 'php' ] && \
9-
exec gosu www-data docker-php-entrypoint "$@"
10-
118
exec docker-php-entrypoint "$@"

.docker/php/ini/symfony.ini

Lines changed: 0 additions & 16 deletions
This file was deleted.

.docker/php/supervisor/process_ui.conf

Lines changed: 0 additions & 12 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.ONESHELL:
22
SHELL := /bin/bash
33

4-
DOCKER_RUN_PHP = docker compose -f .docker/docker-compose.yml -f .docker/docker-compose.override.yml run --rm php "bash" "-c"
5-
DOCKER_COMPOSE = docker compose -f .docker/docker-compose.yml -f .docker/docker-compose.override.yml
4+
DOCKER_RUN_PHP = docker compose -f .docker/compose.yaml run --rm php "bash" "-c"
5+
DOCKER_COMPOSE = docker compose -f .docker/compose.yaml
66

7-
8-
start: upd doctrine/migrations assets/install #[Global] Start application (but not consumers, use supervisorctl/start)
7+
start: upd doctrine/migrations assets/install #[Global] Start application
98

109
src/vendor: #[Composer] install dependencies
1110
$(DOCKER_RUN_PHP) "composer install --no-interaction"
@@ -44,9 +43,6 @@ doctrine/migrations: #[Symfony] Run database migration
4443
assets/install: #[Symfony] Install assets
4544
$(DOCKER_RUN_PHP) "bin/console assets:install"
4645

47-
cache/clean: #[Symfony] Clean cache
48-
$(DOCKER_RUN_PHP) "bin/console c:c"
49-
5046
xdebug/on: #[Docker] Enable xdebug
5147
$(DOCKER_COMPOSE) stop php
5248
XDEBUG_MODE=debug,develop $(DOCKER_COMPOSE) up --remove-orphans --detach

0 commit comments

Comments
 (0)