mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented a new docker compose structure which seperates between docker compose files and environment variable file to protect credentials better. Also did recatoring. Changes not fully tested
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: rebuild wordpress container
|
||||
command:
|
||||
cmd: docker build --no-cache -t custom_wordpress .
|
||||
cmd: docker build --no-cache -t {{custom_wordpress_image}} .
|
||||
chdir: "{{docker_compose.directories.instance}}"
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
|
@@ -27,6 +27,17 @@
|
||||
- docker compose project setup
|
||||
- rebuild wordpress container
|
||||
|
||||
- name: "add docker-compose.yml to {{docker_compose.directories.instance}}"
|
||||
template: src=docker-compose.yml.j2 dest={{docker_compose.directories.instance}}docker-compose.yml
|
||||
- name: "create {{docker_compose.files.docker_compose}}"
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{docker_compose.files.docker_compose}}"
|
||||
notify: docker compose project setup
|
||||
|
||||
- name: "create {{docker_compose.files.env}}"
|
||||
template:
|
||||
src: "env.j2"
|
||||
dest: "{{docker_compose.files.env}}"
|
||||
mode: '770'
|
||||
force: yes
|
||||
notify: docker compose project setup
|
||||
|
||||
|
@@ -3,20 +3,13 @@ services:
|
||||
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
|
||||
|
||||
application:
|
||||
logging:
|
||||
driver: journald
|
||||
image: custom_wordpress
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
image: {{custom_wordpress_image}}
|
||||
container_name: wordpress-application
|
||||
build:
|
||||
context: .
|
||||
restart: {{docker_restart_policy}}
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:80"
|
||||
environment:
|
||||
WORDPRESS_DB_HOST: "{{database_host}}:{{database_port}}"
|
||||
WORDPRESS_DB_USER: "{{database_username}}"
|
||||
WORDPRESS_DB_PASSWORD: "{{database_password}}"
|
||||
WORDPRESS_DB_NAME: "{{database_name}}"
|
||||
volumes:
|
||||
- data:/var/www/html
|
||||
healthcheck:
|
||||
|
4
roles/docker-wordpress/templates/env.j2
Normal file
4
roles/docker-wordpress/templates/env.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
WORDPRESS_DB_HOST= "{{database_host}}:{{database_port}}"
|
||||
WORDPRESS_DB_USER= "{{database_username}}"
|
||||
WORDPRESS_DB_PASSWORD= "{{database_password}}"
|
||||
WORDPRESS_DB_NAME= "{{database_name}}"
|
@@ -1,4 +1,5 @@
|
||||
application_id: "wordpress"
|
||||
wordpress_max_upload_size: "64M"
|
||||
database_type: "mariadb"
|
||||
database_password: "{{wordpress_database_password}}"
|
||||
database_password: "{{wordpress_database_password}}"
|
||||
custom_wordpress_image: "custom_wordpress"
|
Reference in New Issue
Block a user