-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker-compose setup for running tests locally.
- Loading branch information
1 parent
b78062d
commit 86009b2
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
services: | ||
web: | ||
build: ./docker/web | ||
environment: | ||
PHP_IDE_CONFIG: "serverName=localhost" | ||
volumes: | ||
- ./:/var/www/html:cached | ||
working_dir: /var/www/html | ||
ports: | ||
- "8000:80" | ||
depends_on: | ||
- mysql | ||
- pgsql | ||
- memcached | ||
- redis | ||
mysql: | ||
image: mysql:5.6 | ||
platform: linux/amd64 | ||
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: cakephp_test | ||
MYSQL_USER: cakephp_test | ||
MYSQL_PASSWORD: secret | ||
volumes: | ||
- ./docker/mysql:/docker-entrypoint-initdb.d:cached | ||
- mysql-data:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
pgsql: | ||
image: postgres:9.4 | ||
platform: linux/amd64 | ||
environment: | ||
POSTGRES_DB: cakephp_test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
- ./docker/pgsql:/docker-entrypoint-initdb.d:cached | ||
- pgsql-data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
memcached: | ||
image: memcached:latest | ||
hostname: memcached | ||
ports: | ||
- "11211:11211" | ||
redis: | ||
image: "redis:latest" | ||
hostname: redis | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
mysql-data: | ||
pgsql-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE DATABASE IF NOT EXISTS cakephp_test ; | ||
GRANT ALL ON cakephp_test.* TO 'cakephp_test'@'%' ; | ||
CREATE DATABASE IF NOT EXISTS cakephp_test2 ; | ||
GRANT ALL ON cakephp_test2.* TO 'cakephp_test'@'%' ; | ||
CREATE DATABASE IF NOT EXISTS cakephp_test3 ; | ||
GRANT ALL ON cakephp_test3.* TO 'cakephp_test'@'%' ; | ||
FLUSH PRIVILEGES ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
\c cakephp_test | ||
|
||
CREATE SCHEMA test2; | ||
CREATE SCHEMA test3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM php:8.2-apache | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
&& apt-get install -y libpq-dev libzip-dev unzip openssl libmcrypt-dev libmemcached-dev locales \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN docker-php-ext-install pdo_mysql pdo_pgsql zip \ | ||
&& pecl install apcu redis memcached mcrypt xdebug \ | ||
&& docker-php-ext-enable redis memcached mcrypt \ | ||
&& docker-php-ext-enable xdebug \ | ||
&& echo "extension=apcu.so" >> /usr/local/etc/php/php.ini \ | ||
&& echo "apc.enable_cli = 1" >> /usr/local/etc/php/php.ini | ||
|
||
COPY --from=composer /usr/bin/composer /usr/local/bin/composer | ||
|
||
RUN sed -i '/de_DE /s/^# //g' /etc/locale.gen \ | ||
&& sed -i '/es_ES /s/^# //g' /etc/locale.gen \ | ||
&& locale-gen | ||
|
||
ENV APACHE_DOCUMENT_ROOT /var/www/html/app/webroot | ||
|
||
RUN a2enmod rewrite | ||
|
||
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf | ||
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf |