From e885ed948a19fd212482195dcd3272882b0c93b0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 14 Mar 2023 20:20:52 +0000 Subject: [PATCH] build: update configuration files --- .dockerignore | 2 ++ .env.example | 8 +++++--- Dockerfile | 5 +++++ docker-compose.yaml | 6 +++++- justfile | 16 ++++++++-------- phpcs.xml.dist | 1 + phpstan.neon.dist | 2 ++ phpunit.xml.dist | 2 +- .../php/root/usr/local/bin/docker-entrypoint-php | 2 ++ .../web/root/etc/nginx/conf.d/default.conf | 2 ++ 10 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b276be --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/.github +/README.md diff --git a/.env.example b/.env.example index f7bd786..f3b9e70 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ +# Do not edit this file. It is automatically generated by 'build-configs'. + export DOCKER_UID=1000 export COMPOSE_PROJECT_NAME=docker-example-drupal-localgov @@ -5,6 +7,6 @@ export COMPOSE_PROFILES=web,php,database export DOCKER_WEB_VOLUME=.:/app -export MYSQL_DATABASE=app -export MYSQL_PASSWORD=app -export MYSQL_USER=app +export MYSQL_DATABASE=drupal +export MYSQL_PASSWORD=drupal +export MYSQL_USER=drupal diff --git a/Dockerfile b/Dockerfile index 395f3d2..3b7316e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# Do not edit this file. It is automatically generated by 'build-configs'. + FROM php:8.1-fpm-bullseye AS base COPY --from=composer:2 /usr/bin/composer /usr/bin/composer @@ -29,8 +31,11 @@ RUN apt-get update -yqq \ RUN docker-php-ext-install gd pdo_mysql zip +COPY --chown=app:app phpunit.xml* ./ + COPY --chown=app:app assets assets + USER app RUN composer validate --strict diff --git a/docker-compose.yaml b/docker-compose.yaml index 9097f99..3fd36d2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,5 @@ +# Do not edit this file. It is automatically generated by 'build-configs'. + x-app: &default-app volumes: - "${DOCKER_WEB_VOLUME:-./web:/app/web}" @@ -32,12 +34,14 @@ services: `${COMPOSE_PROJECT_NAME}.localhost`, )" profiles: [web] - + php: <<: *default-app build: context: . target: build + volumes: + - .:/app depends_on: - database profiles: [php] diff --git a/justfile b/justfile index 3571c9d..b675064 100644 --- a/justfile +++ b/justfile @@ -1,19 +1,19 @@ +# Do not edit this file. It is automatically generated by 'build-configs'. + default: @just --list composer *args: just _exec php composer {{ args }} -phpunit *args: - just _run --rm php phpunit {{ args }} - -alias test := phpunit - drush *args: just _exec php drush {{ args }} +install *args: + just _exec php drush site:install -y {{ args }} + + + + _exec +args: docker compose exec {{ args }} - -_run +args: - docker compose run {{ args }} diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 2b1f599..138c0c1 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,3 +1,4 @@ + PHPCS configuration file for docker-example-drupal-localgov. diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 76bd437..b629b09 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,3 +1,5 @@ +# Do not edit this file. It is automatically generated by 'build-configs'. + parameters: level: max paths: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2308917..b996820 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ + -