Skip to content

Commit

Permalink
publish 'wordpress' harness
Browse files Browse the repository at this point in the history
  • Loading branch information
kierenevans committed Oct 2, 2020
1 parent 21a8a4c commit 8485b62
Show file tree
Hide file tree
Showing 159 changed files with 5,316 additions and 0 deletions.
109 changes: 109 additions & 0 deletions _twig/docker-compose.yml/application.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{% set blocks = '_twig/docker-compose.yml/' %}
{% set syncvolume = false %}
{% if @('host.os') == 'darwin' and @('docker-sync') == 'yes' %}
{% set syncvolume = true %}
{% elseif @('host.os') == 'darwin' and @('mutagen') == 'yes' %}
{% set syncvolume = true %}
{% endif %}
{% set hostnames = [@('hostname')] %}
{% set hostnames = hostnames|merge(@('hostname_aliases')|map(alias => "#{alias}." ~ @('domain'))) %}

console:
build:
context: ./
dockerfile: .my127ws/docker/image/console/Dockerfile
{% if @('app.build') == 'dynamic' %}
entrypoint: [/entrypoint.dynamic.sh]
command: [sleep, infinity]
volumes:
- {{ (syncvolume) ? @('workspace.name') ~ '-sync:/app:nocopy' : ('./:/app' ~ @('docker.compose.host_volume_options')) }}
- ./.my127ws/application:/home/build/application
- ./.my127ws/docker/image/console/root/lib/task:/lib/task
- ./.my127ws:/.my127ws
{% else %}
image: {{ @('services.console.image') }}
{% endif %}
labels:
- traefik.enable=false
environment: {{ to_nice_yaml(deep_merge([
@('services.php-base.environment'),
@('services.console.environment'),
@('services.php-base.environment_secrets'),
@('services.console.environment_secrets')
]), 2, 6) | raw }}
{% include blocks ~ 'environment.yml.twig' %}
networks:
- private

nginx:
build: .my127ws/docker/image/nginx
{% if @('app.build') == 'dynamic' %}
volumes:
- {{ (syncvolume) ? @('workspace.name') ~ '-sync:/app:nocopy' : ('./:/app' ~ @('docker.compose.host_volume_options')) }}
{% else %}
image: {{ @('services.nginx.image') }}
{% endif %}
labels:
{% if 'varnish' not in @('app.services') %}
- traefik.backend={{ @('workspace.name') }}
- traefik.frontend.rule=Host:{{ hostnames|join(',') }}
- traefik.docker.network=my127ws
- traefik.port=80
{% else %}
- traefik.enable=false
{% endif %}
environment: {{ to_nice_yaml(deep_merge([
@('services.nginx.environment'),
@('services.nginx.environment_secrets')
]), 2, 6) | raw }}
links:
- php-fpm:php-fpm
networks:
{% if 'varnish' not in @('app.services') %}
private:
aliases:
{% for alias in hostnames %}
- {{ alias }}
{% endfor %}
{% else %}
private: {}
{% endif %}
shared: {}

php-fpm:
build: .my127ws/docker/image/php-fpm
{% if @('app.build') == 'dynamic' %}
{% if ("cron" in @('app.services')) %}
image: {{ @('workspace.name') ~ '-php-fpm:dev' }}
{% endif %}
volumes:
- {{ (syncvolume) ? @('workspace.name') ~ '-sync:/app:nocopy' : ('./:/app' ~ @('docker.compose.host_volume_options')) }}
- ./.my127ws:/.my127ws
{% else %}
image: {{ @('services.php-fpm.image') }}
{% endif %}
labels:
- traefik.enable=false
networks:
- private
environment: {{ to_nice_yaml(deep_merge([
@('services.php-base.environment'),
@('services.php-fpm.environment'),
@('services.php-base.environment_secrets'),
@('services.php-fpm.environment_secrets')
]), 2, 6) | raw }}
{% include blocks ~ 'environment.yml.twig' %}
expose:
{% for pool in @('php-fpm.pools') %}
- {{ pool.port }}
{% endfor %}

relay:
build: .my127ws/docker/image/relay
labels:
- traefik.enable=false
networks:
private:
aliases:
- mailhog-relay
shared: {}
Empty file.
10 changes: 10 additions & 0 deletions _twig/docker-compose.yml/service/blackfire.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blackfire:
image: {{ @('services.blackfire.image') }}
labels:
- traefik.enable=false
environment: {{ to_nice_yaml(deep_merge([
@('services.blackfire.environment'),
@('services.blackfire.environment_secrets')
]), 2, 6) | raw }}
networks:
- private
7 changes: 7 additions & 0 deletions _twig/docker-compose.yml/service/chrome.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
chrome:
image: yukinying/chrome-headless-browser:latest
command: ["--no-sandbox", "--disable-gpu", "--headless", "--disable-dev-shm-usage", "--remote-debugging-address=0.0.0.0", "--remote-debugging-port=9222", "--user-data-dir=/data"]
labels:
- traefik.enable=false
networks:
- private
22 changes: 22 additions & 0 deletions _twig/docker-compose.yml/service/cron.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cron:
build:
context: ./
dockerfile: .my127ws/docker/image/cron/Dockerfile
{% if @('app.build') == 'dynamic' %}
volumes:
- {{ (syncvolume) ? @('workspace.name') ~ '-sync:/app:nocopy' : ('./:/app' ~ @('docker.compose.host_volume_options')) }}
- ./.my127ws/application:/home/build/application
{% else %}
image: {{ @('services.cron.image') }}
{% endif %}
environment: {{ to_nice_yaml(deep_merge([
@('services.php-base.environment'),
@('services.cron.environment'),
@('services.php-base.environment_secrets'),
@('services.cron.environment_secrets')
]), 2, 6) | raw }}
{% include blocks ~ 'environment.yml.twig' %}
networks:
- private
labels:
- traefik.enable=false
14 changes: 14 additions & 0 deletions _twig/docker-compose.yml/service/elasticsearch.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
elasticsearch:
image: {{ @('services.elasticsearch.image') }}
labels:
- traefik.enable=false
environment:
ES_JAVA_OPTS: -Xms512m -Xmx512m
discovery.type: single-node
networks:
- private
{% if @('app.build') != 'static' and @('docker.port_forward.enabled') %}
ports:
- "127.0.0.1:0:9200"
- "127.0.0.1:0:9300"
{% endif %}
6 changes: 6 additions & 0 deletions _twig/docker-compose.yml/service/memcached.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
memcached:
image: {{ @('services.memcached.image') }}
labels:
- traefik.enable=false
networks:
- private
21 changes: 21 additions & 0 deletions _twig/docker-compose.yml/service/mysql.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% set command = [] %}
{% for var,value in @('database.var') -%}
{% set command = command|merge(['--' ~ var ~ '=' ~ value]) %}
{% endfor %}
mysql:
image: {{ @('services.mysql.image') }}
labels:
- traefik.enable=false
{% if command|length %}
command: {{ command|join(' ') }}
{% endif %}
environment: {{ to_nice_yaml(deep_merge([
@('services.mysql.environment'),
@('services.mysql.environment_secrets')
]), 2, 6) | raw }}
networks:
- private
{% if @('app.build') != 'static' and @('docker.port_forward.enabled') %}
ports:
- "127.0.0.1:{{ @('database.port_forward') ? @('database.port_forward') : '0' }}:3306"
{% endif %}
12 changes: 12 additions & 0 deletions _twig/docker-compose.yml/service/php-fpm-exporter.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
php-fpm-exporter:
image: {{ @('services.php-fpm-exporter.image') }}
environment: {{ to_nice_yaml(deep_merge([
@('services.php-fpm-exporter.environment'),
@('services.php-fpm-exporter.environment_secrets')
]), 2, 6) | raw }}
labels:
- traefik.enable=false
depends_on:
- php-fpm
networks:
- private
14 changes: 14 additions & 0 deletions _twig/docker-compose.yml/service/postgres.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
postgres:
image: {{ @('services.postgres.image') }}
labels:
- traefik.enable=false
environment: {{ to_nice_yaml(deep_merge([
@('services.postgres.environment'),
@('services.postgres.environment_secrets')
]), 2, 6) | raw }}
networks:
- private
{% if @('app.build') != 'static' and @('docker.port_forward.enabled') %}
ports:
- "127.0.0.1:{{ @('database.port_forward') ? @('database.port_forward') : '0' }}:5432"
{% endif %}
16 changes: 16 additions & 0 deletions _twig/docker-compose.yml/service/rabbitmq.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rabbitmq:
image: {{ @('services.rabbitmq.image') }}
environment: {{ to_nice_yaml(deep_merge([
@('services.rabbitmq.environment'),
@('services.rabbitmq.environment_secrets')
]), 2, 6) | raw }}
networks:
- private
- shared
labels:
- traefik.backend={{ @('rabbitmq.host') }}-{{ @('workspace.name') }}
- traefik.frontend.rule=Host:{{ @('rabbitmq.external_host') }}
- traefik.docker.network=my127ws
- traefik.port={{ @('rabbitmq.api_port') }}
- co.elastic.logs/module=rabbitmq
- co.elastic.metrics/module=rabbitmq
8 changes: 8 additions & 0 deletions _twig/docker-compose.yml/service/redis-session.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
redis-session:
image: {{ @('services.redis_session.image') }}
# 1GB; evict key that would expire soonest
command: redis-server --maxmemory 1073742000 --maxmemory-policy volatile-ttl --save 3600 1 --save 300 100 --save 60 10000
labels:
- traefik.enable=false
networks:
- private
8 changes: 8 additions & 0 deletions _twig/docker-compose.yml/service/redis.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
redis:
image: {{ @('services.redis.image') }}
# 1GB; evict any least recently used key even if they don't have a TTL
command: redis-server --maxmemory 1073742000 --maxmemory-policy allkeys-lru --save 3600 1 --save 300 100 --save 60 10000
labels:
- traefik.enable=false
networks:
- private
11 changes: 11 additions & 0 deletions _twig/docker-compose.yml/service/tideways.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tideways:
build:
context: .my127ws/docker/image/tideways/
labels:
- traefik.enable=false
environment: {{ to_nice_yaml(deep_merge([
@('services.tideways.environment'),
@('services.tideways.environment_secrets')
]), 2, 6) | raw }}
networks:
- private
49 changes: 49 additions & 0 deletions _twig/docker-compose.yml/service/varnish.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% if 'varnish' in @('app.services') %}
{% set hostnames = [@('hostname')] %}
{% set hostnames = hostnames|merge(@('hostname_aliases')|map(alias => "#{alias}." ~ @('domain'))) %}
varnish:
image: {{ @('services.varnish.image') }}
labels:
- traefik.backend={{ @('workspace.name') }}
- traefik.frontend.rule=Host:{{ hostnames|join(',') }}
- traefik.docker.network=my127ws
- traefik.port=80
environment: {{ to_nice_yaml(deep_merge([
@('services.varnish.environment'),
@('services.varnish.environment_secrets')
]), 2, 6) | raw }}
links:
- nginx:nginx
volumes:
- .my127ws/docker/image/varnish/root/etc/varnish/default.vcl:/etc/varnish/default.vcl:ro
- type: tmpfs
target: /var/lib/varnish:exec
tmpfs:
size: "100000"
networks:
private:
aliases:
- varnish-0.varnish-headless
{% if @('replicas.varnish') > 1 %}
{% for instanceNumber in 1..(@('replicas.varnish')-1) %}
- varnish-{{ instanceNumber }}.varnish-headless
{% endfor %}
{% endif %}
shared: {}

# Provide TLS offloading for integration tests via varnish
tls-offload:
build:
context: .my127ws/docker/image/tls-offload/
labels:
- traefik.enable=false
links:
- varnish:varnish
networks:
private:
aliases:
{% for alias in hostnames %}
- {{ alias }}
{% endfor %}
shared: {}
{% endif %}
8 changes: 8 additions & 0 deletions application/overlay/.dockerignore.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% set build = @('app.build') %}
{% set blocks = 'application/overlay/_twig/.dockerignore/' %}

{% if build == 'dynamic' %}
{% include blocks ~ 'dynamic.twig' %}
{% else %}
{% include blocks ~ 'static.twig' %}
{% endif %}
Loading

0 comments on commit 8485b62

Please sign in to comment.