diff --git a/Dockerfile b/Dockerfile index 87d90ff8fb..ff76606273 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact -ARG PHP_VERSION=7.4.28 -ARG NGINX_VERSION=1.17 +ARG PHP_VERSION=8.3 +ARG NGINX_VERSION=1.27.3 # "php" stage -FROM php:${PHP_VERSION}-fpm-alpine3.15 AS bewelcome_php +FROM php:${PHP_VERSION}-fpm-alpine3.21 AS bewelcome_php # persistent / runtime deps RUN apk add --no-cache \ @@ -25,7 +25,7 @@ RUN apk add --no-cache \ python3 \ ; -ARG APCU_VERSION=5.1.18 +ARG APCU_VERSION=5.1.24 RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ @@ -46,7 +46,6 @@ RUN set -eux; \ mysqli \ pcntl \ pdo_mysql \ - xmlrpc \ xsl \ zip \ exif \ @@ -126,7 +125,7 @@ RUN set -eux; \ composer clear-cache # prevent the reinstallation of node_modules at every changes in the source code -COPY package.json yarn.lock webpack.config.js postcss.config.js tailwind.config.js ./ +COPY package.json yarn.lock webpack.config.js postcss.config.js tailwind.config.js tsconfig.json ./ RUN set -eux; \ yarn install --frozen-lock; \ yarn encore production --mode=production diff --git a/Makefile b/Makefile index 89ebfeb9fc..f9dc616eea 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,12 @@ phpci: phpcpd phploc phpmd php-code-sniffer phpunit infection behat version install: git rev-parse --short HEAD > VERSION test -f docker-compose.override.yml || cp docker-compose.override.yml.dist docker-compose.override.yml - curl https://downloads.bewelcome.org/for_developers/rox_test_db/languages.sql.bz2 -o ./docker/db/languages.sql.bz2 - curl https://downloads.bewelcome.org/for_developers/rox_test_db/words.sql.bz2 -o ./docker/db/words.sql.bz2 - bunzip2 --force ./docker/db/languages.sql.bz2 ./docker/db/words.sql.bz2 + bzip2 -ckd docker/languages.sql.bz2 > docker/db/languages.sql + bzip2 -ckd docker/words.sql.bz2 > docker/db/words.sql ifdef root - sudo docker-compose up -d + sudo docker compose up -d else - docker-compose up -d + docker compose up -d endif install-geonames: @@ -34,9 +33,9 @@ install-geonames: unzip docker/db/alternateNames.zip -d docker/db/ rm docker/db/*.zip ifdef root - sudo docker-compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql" + sudo docker compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql" else - docker-compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql" + docker compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql" endif phpcsfix: diff --git a/docker-compose.override.yml.dist b/docker-compose.override.yml.dist index 748a8b608c..eb4a8e4e6b 100644 --- a/docker-compose.override.yml.dist +++ b/docker-compose.override.yml.dist @@ -1,5 +1,3 @@ -version: '3.4' - services: web: ports: diff --git a/docker-compose.yml b/docker-compose.yml index 18dce29f1b..e3826d39f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.4' - x-cache-from: - &cache-from cache_from: @@ -41,7 +39,7 @@ services: - ./public:/srv/bewelcome/public:ro db: - image: mariadb:10.1.41 + image: mariadb:11.6.2 environment: MYSQL_ROOT_PASSWORD: bewelcome_root_dev MYSQL_DATABASE: bewelcome @@ -52,7 +50,7 @@ services: manticore: container_name: manticore - image: manticoresearch/manticore:5.0.2 + image: manticoresearch/manticore:6.3.8 environment: - EXTRA=1 restart: always diff --git a/docker/languages.sql.bz2 b/docker/languages.sql.bz2 new file mode 100755 index 0000000000..adaf95b4cb Binary files /dev/null and b/docker/languages.sql.bz2 differ diff --git a/docker/php/docker-entrypoint.sh b/docker/php/docker-entrypoint.sh index 70671f327b..5d86d95150 100755 --- a/docker/php/docker-entrypoint.sh +++ b/docker/php/docker-entrypoint.sh @@ -52,32 +52,44 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then sleep 1 done + echo "db ready!" if [ "$APP_ENV" != 'prod' ]; then + echo "Creating database..." bin/console test:database:create --drop --force --no-interaction + echo "Database created." + database_host=$(grep '^DB_HOST=' .env | cut -f 2 -d '=') database_port=$(grep '^DB_PORT=' .env | cut -f 2 -d '=') database_name=$(grep '^DB_NAME=' .env | cut -f 2 -d '=') database_user=$(grep '^DB_USER=' .env | cut -f 2 -d '=') database_password=$(grep '^DB_PASS=' .env | cut -f 2 -d '=') + echo "$database_name" + echo "$database_port" + echo "$database_user" + echo "$database_password" if [ -f docker/db/languages.sql ]; then - mysql $database_name -u $database_user -p$database_password -h $database_host < docker/db/languages.sql + mariadb $database_name -u $database_user -p$database_password -h $database_host < docker/db/languages.sql fi if [ -f docker/db/words.sql ]; then - mysql $database_name -u $database_user -p$database_password -h $database_host < docker/db/words.sql + mariadb $database_name -u $database_user -p$database_password -h $database_host < docker/db/words.sql fi if [ -f docker/db/geonamesadminunits.sql ]; then - mysql $database_name -u $database_user -p$database_password -h $database_host < docker/db/geonamesadminunits.sql + mariadb $database_name -u $database_user -p$database_password -h $database_host < docker/db/geonamesadminunits.sql fi + echo "Database updated!" elif ls -A src/Migrations/*.php > /dev/null 2>&1; then + echo "migration" bin/console doctrine:migrations:migrate --no-interaction fi - + echo "warmup" # WarmUp translations now database is up to date composer run-script --no-dev post-install-cmd if [ "$APP_ENV" != 'prod' ]; then + echo "yarn" yarn encore dev --mode=development fi fi +echo "docker-php" exec docker-php-entrypoint "$@" diff --git a/docker/words.sql.bz2 b/docker/words.sql.bz2 new file mode 100755 index 0000000000..3753feb4fb Binary files /dev/null and b/docker/words.sql.bz2 differ diff --git a/tsconfig.json b/tsconfig.json index 9e26dfeeb6..ee6eb3b570 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "files": [ + "assets/js/admin/tools/login_message.ts" + ] +}