-
Notifications
You must be signed in to change notification settings - Fork 8
Add a Docker configuration #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| /usr/bin/composer validate && \ | ||
| /usr/bin/composer --ignore-platform-reqs install \ | ||
| --no-ansi --no-progress --no-scripts \ | ||
| --classmap-authoritative --no-interaction \ | ||
| --quiet |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| services: | ||
| php: | ||
| build: | ||
| context: ./ | ||
| dockerfile: docker/php/Dockerfile | ||
| args: | ||
| - PHP_VERSION=${PHP_VERSION:-8.3.19} | ||
| volumes: | ||
| - ./:/var/www/html | ||
| depends_on: | ||
| - mysql | ||
| - postgresql | ||
|
|
||
| mysql: | ||
| build: | ||
| context: ./ | ||
| dockerfile: docker/databases/mysql/Dockerfile | ||
| args: | ||
| - VERSION=${MYSQL_VERSION:-8.0.41} | ||
| ports: | ||
| - "3306:3306" | ||
| environment: | ||
| - MYSQL_DATABASE=${MYSQL_DATABASE:-laminasdb_test} | ||
| - MYSQL_USER=${MYSQL_USER:-user} | ||
| - MYSQL_PASSWORD=${MYSQL_PASSWORD:-password} | ||
| - MYSQL_RANDOM_ROOT_PASSWORD=${MYSQL_RANDOM_ROOT_PASSWORD:-yes} | ||
| volumes: | ||
| - ./test/integration/TestFixtures/mysql.sql:/docker-entrypoint-initdb.d/mysql.sql | ||
| healthcheck: | ||
| test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] | ||
| timeout: 20s | ||
| retries: 10 | ||
|
|
||
| postgresql: | ||
| build: | ||
| context: ./ | ||
| dockerfile: docker/databases/postgresql/Dockerfile | ||
| args: | ||
| - VERSION=${VERSION:-17.4} | ||
| - ALPINE_VERSION=${ALPINE_VERSION:-3.21} | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - ./test/integration/TestFixtures/pgsql.sql:/docker-entrypoint-initdb.d/pgsql.sql | ||
| environment: | ||
| - POSTGRES_DB=${POSTGRES_DB:-laminasdb_test} | ||
| - POSTGRES_USER=${POSTGRES_USER:-postgres} | ||
| - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-laminasdb_test}'"] | ||
| interval: 30s | ||
| timeout: 60s | ||
| retries: 5 | ||
| start_period: 80s |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ARG VERSION=8.4.5 | ||
|
|
||
| FROM mysql:${VERSION}-bookworm AS base |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ARG VERSION=17.4 | ||
| ARG ALPINE_VERSION=3.21 | ||
|
|
||
| FROM postgres:${VERSION}-alpine${ALPINE_VERSION} AS base |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ARG PHP_VERSION=8.3.19 | ||
|
|
||
| FROM php:${PHP_VERSION}-apache-bookworm AS base | ||
|
|
||
| # Copy Composer from the official Docker Hub repository to the local filesystem | ||
| COPY --from=composer:2.8.6 /usr/bin/composer /usr/bin/ | ||
|
|
||
| # Install the database extensions for MySQL, PostgreSQL, and SQLite, their | ||
| # dependencies, and any other tools that are required for the environment to be | ||
| # used fully and completely. | ||
| RUN apt-get update \ | ||
| && apt-get install -y git libpq-dev libsqlite3-dev \ | ||
| && docker-php-ext-install mysqli pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql \ | ||
| && apt-get clean | ||
|
|
||
| # Allow the www-data login so that it can run Composer instead of using root | ||
| RUN usermod -s /usr/bin/bash www-data | ||
|
|
||
| # Copy all of the files from the context to the current directory setting the | ||
| # correct owner | ||
| COPY --chown=www-data:www-data . . | ||
|
|
||
| RUN chmod +x bin/install-deps.sh | ||
|
|
||
| # Validate and install PHP's dependencies | ||
| RUN su --preserve-environment www-data --command "bin/install-deps.sh" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| error_reporting=E_ALL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| zend_extension=xdebug | ||
|
|
||
| [xdebug] | ||
| xdebug.mode=develop,debug | ||
| xdebug.client_host=host.docker.internal | ||
| xdebug.start_with_request=yes |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 23 is most likely why you are getting the listener error.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although, I'm not sure why unless this was affected by the huge amount of changes to the event system in the newer versions of Phpunit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line suppose to remain in docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 71 is the line I was referencing there.