mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	Refactored docker-compose roles
This commit is contained in:
		@@ -1,24 +1,20 @@
 | 
			
		||||
services:
 | 
			
		||||
{% include 'roles/docker-compose/templates/base.yml.j2' %}
 | 
			
		||||
 | 
			
		||||
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
 | 
			
		||||
  moodle:
 | 
			
		||||
{% set container_port = 8008 %}
 | 
			
		||||
    container_name: {{ container_name }}
 | 
			
		||||
    build:
 | 
			
		||||
      context: .
 | 
			
		||||
      dockerfile: Dockerfile
 | 
			
		||||
    image: moodle_custom
 | 
			
		||||
    ports:
 | 
			
		||||
      - 127.0.0.1:{{ports.localhost.http[application_id]}}:8080
 | 
			
		||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
 | 
			
		||||
      - 127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}
 | 
			
		||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - 'code:{{ bitnami_code_link }}'
 | 
			
		||||
      - 'data:{{ bitnami_data_dir }}'
 | 
			
		||||
    healthcheck:
 | 
			
		||||
      test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q 'HTTP/1.1'"]
 | 
			
		||||
      interval: 30s
 | 
			
		||||
      timeout: 10s
 | 
			
		||||
      retries: 3
 | 
			
		||||
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
 | 
			
		||||
{% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %}
 | 
			
		||||
{% include 'roles/docker-container/templates/depends_on_dmbs.j2' %}
 | 
			
		||||
{% include 'templates/docker/container/networks.yml.j2' %}
 | 
			
		||||
 | 
			
		||||
{% include 'templates/docker/compose/volumes.yml.j2' %}
 | 
			
		||||
 
 | 
			
		||||
@@ -24,4 +24,8 @@ csp:
 | 
			
		||||
      - "https://cdn.jsdelivr.net"
 | 
			
		||||
domains:
 | 
			
		||||
  canonical:
 | 
			
		||||
    - "academy.{{ primary_domain }}"
 | 
			
		||||
    - "academy.{{ primary_domain }}"
 | 
			
		||||
docker:
 | 
			
		||||
  services:
 | 
			
		||||
    database:
 | 
			
		||||
      enabled: true
 | 
			
		||||
		Reference in New Issue
	
	Block a user