build: update configuration files

This commit is contained in:
Oliver Davies 2023-03-14 20:20:48 +00:00
parent 62bb4776d3
commit 1c8d5c87f9
10 changed files with 88 additions and 58 deletions

View file

@ -1,31 +1,2 @@
/.editorconfig /.github
/.gitattributes /README.md
/vendor/
/web/.csslintrc
/web/.eslintignore
/web/.eslintrc.json
/web/.ht.router.php
/web/.htaccess
/web/INSTALL.txt
/web/README.md
/web/autoload.php
/web/core/
/web/example.gitignore
/web/index.php
/web/modules/README.txt
/web/profiles/README.txt
/web/robots.txt
/web/sites/*/files/
/web/sites/*/private/
/web/sites/*/services*.yml
/web/sites/*/settings*.php
/web/sites/README.txt
/web/sites/default/default.services.yml
/web/sites/default/default.settings.php
/web/sites/development.services.yml
/web/sites/example.settings.local.php
/web/sites/example.sites.php
/web/sites/simpletest/
/web/themes/README.txt
/web/update.php
/web/web.config

View file

@ -1,4 +1,12 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
export DOCKER_UID=1000
export COMPOSE_PROJECT_NAME=docker-example-drupal export COMPOSE_PROJECT_NAME=docker-example-drupal
export COMPOSE_PROFILES=web,php,database export COMPOSE_PROFILES=web,php,database
export DOCKER_WEB_VOLUME=.:/app export DOCKER_WEB_VOLUME=.:/app
export MYSQL_DATABASE=drupal
export MYSQL_PASSWORD=drupal
export MYSQL_USER=drupal

View file

@ -1,29 +1,46 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
FROM php:8.1-fpm-bullseye AS base FROM php:8.1-fpm-bullseye AS base
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V RUN which composer && composer -V
ARG DOCKER_UID=1000
ENV DOCKER_UID="${DOCKER_UID}"
WORKDIR /app WORKDIR /app
ENV PATH="${PATH}:/app/vendor/bin" RUN adduser --disabled-password --uid "${DOCKER_UID}" app \
&& chown app:app -R /app
COPY composer.* ./ USER app
ENV PATH="${PATH}:/app/bin:/app/vendor/bin"
COPY --chown=app:app composer.* ./
################################################################################ ################################################################################
FROM base AS build FROM base AS build
USER root
RUN apt-get update -yqq \ RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \ && apt-get install -yqq --no-install-recommends \
git libpng-dev libzip-dev mariadb-client unzip git libpng-dev libzip-dev mariadb-client unzip
RUN docker-php-ext-install gd pdo_mysql zip RUN docker-php-ext-install gd pdo_mysql zip
COPY --chown=app:app phpunit.xml* ./
USER app
RUN composer validate RUN composer validate
RUN composer install RUN composer install
COPY tools/docker/images/php/root / COPY --chown=app:app tools/docker/images/php/root /
ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"] ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"]
CMD ["php-fpm"] CMD ["php-fpm"]
@ -32,13 +49,15 @@ CMD ["php-fpm"]
FROM base AS test FROM base AS test
COPY . . COPY --chown=app:app . .
RUN parallel-lint src --no-progress \ RUN parallel-lint src --no-progress \
&& phpcs -vv \ && phpcs -vv \
&& phpstan \ && phpstan \
&& phpunit --testdox && phpunit --testdox
################################################################################ ################################################################################
FROM nginx:1 as web FROM nginx:1 as web

View file

@ -1,3 +1,5 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
x-app: &default-app x-app: &default-app
volumes: volumes:
- "${DOCKER_WEB_VOLUME:-./web:/app/web}" - "${DOCKER_WEB_VOLUME:-./web:/app/web}"
@ -32,12 +34,14 @@ services:
`${COMPOSE_PROJECT_NAME}.localhost`, `${COMPOSE_PROJECT_NAME}.localhost`,
)" )"
profiles: [web] profiles: [web]
php: php:
<<: *default-app <<: *default-app
build: build:
context: . context: .
target: build target: build
volumes:
- .:/app
depends_on: depends_on:
- database - database
profiles: [php] profiles: [php]
@ -57,14 +61,10 @@ services:
- "traefik.enabled=false" - "traefik.enabled=false"
environment: environment:
MYSQL_RANDOM_ROOT_PASSWORD: true MYSQL_RANDOM_ROOT_PASSWORD: true
MYSQL_DATABASE: drupal
MYSQL_PASSWORD: drupal
MYSQL_USER: drupal
profiles: [database] profiles: [database]
volumes: volumes:
db-data: {} db-data: {}
networks: networks:
web: web:
name: traefik_proxy name: traefik_proxy

View file

@ -1,3 +1,5 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
default: default:
@just --list @just --list
@ -7,5 +9,11 @@ composer *args:
drush *args: drush *args:
just _exec php drush {{ args }} just _exec php drush {{ args }}
install *args:
just _exec php drush site:install -y {{ args }}
_exec +args: _exec +args:
docker compose exec {{ args }} docker compose exec {{ args }}

View file

@ -1,3 +1,4 @@
<!-- Do not edit this file. It is automatically generated by 'build-configs'. -->
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset name="docker-example-drupal coding standards"> <ruleset name="docker-example-drupal coding standards">
<description>PHPCS configuration file for docker-example-drupal.</description> <description>PHPCS configuration file for docker-example-drupal.</description>

View file

@ -1,3 +1,5 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
parameters: parameters:
level: max level: max
paths: paths:

View file

@ -1,20 +1,37 @@
<!-- Do not edit this file. It is automatically generated by 'build-configs'. -->
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" beStrictAboutChangesToGlobalState="true"
bootstrap="vendor/autoload.php" beStrictAboutOutputDuringTests="true"
cacheResultFile=".phpunit.cache/test-results" beStrictAboutTestsThatDoNotTestAnything="true"
executionOrder="depends,defects" bootstrap="web/core/tests/bootstrap.php"
forceCoversAnnotation="false" cacheResult="false"
beStrictAboutCoversAnnotation="true" colors="true"
beStrictAboutOutputDuringTests="false" failOnWarning="true"
beStrictAboutTodoAnnotatedTests="true" printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"
convertDeprecationsToExceptions="true" >
failOnRisky="true" <php>
failOnWarning="true" <env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>
verbose="true"> <env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<testsuites> <env name="MINK_DRIVER_ARGS" value=''/>
<testsuite name="docker-example-drupal"> <env name="MINK_DRIVER_ARGS_WEBDRIVER" value=''/>
<directory>tests</directory> <env name="MINK_DRIVER_CLASS" value=''/>
</testsuite> <env name="SIMPLETEST_BASE_URL" value="http://web"/>
</testsuites> <env name="SIMPLETEST_DB" value="sqlite://localhost//dev/shm/test.sqlite"/>
<ini name="error_reporting" value="32767"/>
<ini name="memory_limit" value="-1"/>
</php>
<testsuites>
<testsuite name="functional">
<directory>./web/modules/custom/**/tests/**/Functional</directory>
</testsuite>
<testsuite name="kernel">
<directory>./web/modules/custom/**/tests/**/Kernel</directory>
</testsuite>
<testsuite name="unit">
<directory>./web/modules/custom/**/tests/**/Unit</directory>
</testsuite>
</testsuites>
</phpunit> </phpunit>

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Do not edit this file. It is automatically generated by 'build-configs'.
[[ -f composer.json && ! -d vendor ]] && composer install [[ -f composer.json && ! -d vendor ]] && composer install
eval "$@" eval "$@"

View file

@ -1,3 +1,5 @@
# Do not edit this file. It is automatically generated by 'build-configs'.
server { server {
server_name _; server_name _;