Skip to content

Commit

Permalink
chore (docker) upgrade symfony to 6.4 and migrate php-fpm docker to a…
Browse files Browse the repository at this point in the history
…lpine
  • Loading branch information
louis authored and EdouardCourty committed Feb 18, 2024
1 parent e995007 commit 9c47bcd
Show file tree
Hide file tree
Showing 5 changed files with 1,075 additions and 1,009 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM php:8.2-fpm-bullseye
FROM php:8.2-fpm-alpine

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/project

RUN apt update && apt install -y \
RUN apk update && apk add \
vim \
git \
libzip-dev \
libicu-dev \
icu-dev \
zip \
libssh-dev \
make \
libcurl3-dev \
libgmp-dev \
libpq-dev
curl-dev \
gmp-dev \
libpq \
postgresql-dev

COPY docker/php-fpm/php-fpm.conf /usr/local/etc/php-fpm.conf
COPY docker/php/php.ini /usr/local/etc/php/php.ini
Expand All @@ -31,8 +31,7 @@ RUN docker-php-ext-install \
gmp \
opcache

RUN useradd -ms /bin/bash project_user
RUN usermod -u 1000 project_user
RUN adduser -s /bin/ash -u 1000 -D project_user project_user

RUN touch /var/log/php-fpm.error.log
RUN touch /var/log/php-fpm.access.log
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ docker-restart: dk-up
install: build up vendor dk-reload-database ## Gets the project running from scratch

bash: ## Starts a bash on the PHP server
$(DKC) exec server bash
$(DKC) exec server ash

vendor: ## Installs the PHP dependencies
$(DKC) exec server bash -c "composer install"
$(DKC) exec server ash -c "composer install"

cc: ## Clears the Symfony cache
$(DKC) exec server bash -c "$(BCL) cache:clear"
$(DKC) exec server ash -c "$(BCL) cache:clear"

_drop-database:
$(BCL) doctrine:database:drop --force
Expand All @@ -59,23 +59,23 @@ _reload-database:
$(BCL) doctrine:fixtures:load --no-interaction

reload-database: ## Reloads a clean database from the fixtures
$(DKC) exec server bash -c "make _reload-database"
$(DKC) exec server ash -c "make _reload-database"

migrate: ## Migrates the database to the latest version
$(DKC) exec server bash -c "make _execute-migrations"
$(DKC) exec server ash -c "make _execute-migrations"

make-mig: ## Creates a new migration from the latest schema changes
$(DKC) exec server bash -c "$(BCL) make:migration"
$(DKC) exec server ash -c "$(BCL) make:migration"

##⛩️ CodeStyle & Tests
phpcs: ## Checks the PSR-12 compliance
$(DKC) exec server bash -c "$(PHPCS) --standard=PSR12 --extensions=php -n src"
$(DKC) exec server ash -c "$(PHPCS) --standard=PSR12 --extensions=php -n src"

phpunit: ## Runs the PHPUnit tests
$(DKC) exec server bash -c "$(PHPUNIT)"
$(DKC) exec server ash -c "$(PHPUNIT)"

phpstan: ## Runs the PHPStan
$(DKC) exec server bash -c "$(PHPSTAN)"
$(DKC) exec server ash -c "$(PHPSTAN)"

# These line avoid make to confuse argument with target
%:
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"doctrine/orm": "^2.10",
"psr/log": "1.1.4",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "6.3.*",
"symfony/console": "6.3.*",
"symfony/dotenv": "6.3.*",
"symfony/asset": "6.4.*",
"symfony/console": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "6.3.*",
"symfony/mime": "6.3.*",
"symfony/framework-bundle": "6.4.*",
"symfony/mime": "6.4.*",
"symfony/monolog-bundle": "^3.0",
"symfony/proxy-manager-bridge": "6.3.*",
"symfony/runtime": "6.3.*",
"symfony/security-bundle": "6.3.*",
"symfony/translation": "6.3.*",
"symfony/twig-bundle": "6.3.*",
"symfony/uid": "6.3.*",
"symfony/validator": "6.3.*",
"symfony/yaml": "6.3.*",
"symfony/proxy-manager-bridge": "6.4.*",
"symfony/runtime": "6.4.*",
"symfony/security-bundle": "6.4.*",
"symfony/translation": "6.4.*",
"symfony/twig-bundle": "6.4.*",
"symfony/uid": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/yaml": "6.4.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
Expand All @@ -42,11 +42,11 @@
"phpunit/phpunit": "^10.1",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.6",
"symfony/debug-bundle": "6.3.*",
"symfony/debug-bundle": "6.4.*",
"symfony/maker-bundle": "^1.34",
"symfony/phpunit-bridge": "^6.0",
"symfony/stopwatch": "6.3.*",
"symfony/web-profiler-bundle": "6.3.*"
"symfony/stopwatch": "6.4.*",
"symfony/web-profiler-bundle": "6.4.*"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -94,7 +94,7 @@
"extra": {
"symfony": {
"allow-contrib": true,
"require": "6.3.*"
"require": "6.4.*"
}
}
}
Loading

0 comments on commit 9c47bcd

Please sign in to comment.