From bf0017a4af819b797fe68ed0f8ddcefc6f105d64 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 6 Dec 2024 18:39:18 +0100 Subject: [PATCH] add docker-compose.yml exemples --- exemple/compose/hote/full/docker-compose.yml | 63 +++++++++++++++++ exemple/compose/hote/mysql/docker-compose.yml | 40 +++++++++++ exemple/compose/hote/pgsql/docker-compose.yml | 38 ++++++++++ .../compose/hote/sqlite/docker-compose.yml | 13 ++++ .../compose/volume/full/docker-compose.yml | 69 +++++++++++++++++++ .../compose/volume/mysql/docker-compose.yml | 43 ++++++++++++ .../compose/volume/pgsql/docker-compose.yml | 41 +++++++++++ .../compose/volume/sqlite/docker-compose.yml | 8 +-- 8 files changed, 311 insertions(+), 4 deletions(-) create mode 100644 exemple/compose/hote/full/docker-compose.yml create mode 100644 exemple/compose/hote/mysql/docker-compose.yml create mode 100644 exemple/compose/hote/pgsql/docker-compose.yml create mode 100644 exemple/compose/hote/sqlite/docker-compose.yml create mode 100644 exemple/compose/volume/full/docker-compose.yml create mode 100644 exemple/compose/volume/mysql/docker-compose.yml create mode 100644 exemple/compose/volume/pgsql/docker-compose.yml diff --git a/exemple/compose/hote/full/docker-compose.yml b/exemple/compose/hote/full/docker-compose.yml new file mode 100644 index 0000000..5f5acb3 --- /dev/null +++ b/exemple/compose/hote/full/docker-compose.yml @@ -0,0 +1,63 @@ +services: + # Nginx proxy manager + npmapp: + image: 'jc21/nginx-proxy-manager:latest' + restart: unless-stopped + container_name: npmapp + ports: + - 80:80 + - 443:443 + - 81:81 + volumes: + - ./dcstable/npm/data:/data + - ./dcstable/npm/letsencrypt:/etc/letsencrypt + healthcheck: + test: ["CMD", "/usr/bin/check-health"] + interval: 10s + timeout: 3s + + # Mariadb database + dcstabledb: + image: mariadb:latest + container_name: dcstabledb + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW + volumes: + - ./dcstable/db:/var/lib/mysql + depends_on: + npmapp: + condition: service_healthy + environment: + MYSQL_ROOT_PASSWORD: dotclear_root + MYSQL_DATABASE: dotclear_db + MYSQL_USER: dotclear_user + MYSQL_PASSWORD: dotclear_pwd + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 + + # Doclear web application + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + volumes: + - ./dcstable/app:/var/www/dotclear + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: mysqlimb4 + DC_DBHOST: dcstabledb + DC_DBNAME: dotclear_db + DC_DBUSER: dotclear_user + DC_DBPASSWORD: dotclear_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com + +networks: + default: + name: npm \ No newline at end of file diff --git a/exemple/compose/hote/mysql/docker-compose.yml b/exemple/compose/hote/mysql/docker-compose.yml new file mode 100644 index 0000000..b767d03 --- /dev/null +++ b/exemple/compose/hote/mysql/docker-compose.yml @@ -0,0 +1,40 @@ +# jcpd/docker-dotclear:latest +services: + dcstabledb: + image: mariadb:latest + container_name: dcstabledb + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW + volumes: + - ./dcstable/db:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: dotclear_root + MYSQL_DATABASE: dotclear_db + MYSQL_USER: dotclear_user + MYSQL_PASSWORD: dotclear_pwd + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 + + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + volumes: + - ./dcstable/app:/var/www/dotclear + ports: + - 80:80 + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: mysqlimb4 + DC_DBHOST: dcstabledb + DC_DBNAME: dotclear_db + DC_DBUSER: dotclear_user + DC_DBPASSWORD: dotclear_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com diff --git a/exemple/compose/hote/pgsql/docker-compose.yml b/exemple/compose/hote/pgsql/docker-compose.yml new file mode 100644 index 0000000..f1bedd1 --- /dev/null +++ b/exemple/compose/hote/pgsql/docker-compose.yml @@ -0,0 +1,38 @@ +services: + + dcstabledb: + image: postgres + container_name: dcstabledb + restart: unless-stopped + environment: + POSTGRES_PASSWORD: dcstable_pwd + POSTGRES_USER: dcstable_user + POSTGRES_DB: dcstable_db + PGDATA: /var/lib/postgresql/data/pgdata + volumes: + - ./dcstable/db:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] + interval: 1s + timeout: 5s + retries: 10 + + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + ports: + - 80:80 + volumes: + - ./dcstable/app:/var/www/dotclear + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: pgsql + DC_DBHOST: dcstabledb + DC_DBNAME: dcstable_db + DC_DBUSER: dcstable_user + DC_DBPASSWORD: dcstable_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com diff --git a/exemple/compose/hote/sqlite/docker-compose.yml b/exemple/compose/hote/sqlite/docker-compose.yml new file mode 100644 index 0000000..59c5411 --- /dev/null +++ b/exemple/compose/hote/sqlite/docker-compose.yml @@ -0,0 +1,13 @@ +services: + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + volumes: + - ./dcstable:/var/www/dotclear + ports: + - 80:80 + environment: + DC_DBDRIVER: sqlite + DC_DBNAME: \var\www\dotclear\sqlite.db + DC_ADMINMAILFROM: contact@exemple.com diff --git a/exemple/compose/volume/full/docker-compose.yml b/exemple/compose/volume/full/docker-compose.yml new file mode 100644 index 0000000..7b412a7 --- /dev/null +++ b/exemple/compose/volume/full/docker-compose.yml @@ -0,0 +1,69 @@ +services: + # Nginx proxy manager + npmapp: + image: 'jc21/nginx-proxy-manager:latest' + restart: unless-stopped + container_name: npmapp + ports: + - 80:80 + - 443:443 + - 81:81 + volumes: + - npm_data:/data + - npm_letsencrypt:/etc/letsencrypt + healthcheck: + test: ["CMD", "/usr/bin/check-health"] + interval: 10s + timeout: 3s + + # Mariadb database + dcstabledb: + image: mariadb:latest + container_name: dcstabledb + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW + volumes: + - dcstable_db:/var/lib/mysql + depends_on: + npmapp: + condition: service_healthy + environment: + MYSQL_ROOT_PASSWORD: dotclear_root + MYSQL_DATABASE: dotclear_db + MYSQL_USER: dotclear_user + MYSQL_PASSWORD: dotclear_pwd + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 + + # Doclear web application + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + volumes: + - dcstable_app:/var/www/dotclear + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: mysqlimb4 + DC_DBHOST: dcstabledb + DC_DBNAME: dotclear_db + DC_DBUSER: dotclear_user + DC_DBPASSWORD: dotclear_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com + +networks: + default: + name: npm + +volumes: + npm_data: + npm_letsencrypt: + dcstable_db: + dcstable_app: \ No newline at end of file diff --git a/exemple/compose/volume/mysql/docker-compose.yml b/exemple/compose/volume/mysql/docker-compose.yml new file mode 100644 index 0000000..9deeb4e --- /dev/null +++ b/exemple/compose/volume/mysql/docker-compose.yml @@ -0,0 +1,43 @@ +# jcpd/docker-dotclear:latest +services: + dcstabledb: + image: mariadb:latest + container_name: dcstabledb + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW + volumes: + - dcstable/db:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: dotclear_root + MYSQL_DATABASE: dotclear_db + MYSQL_USER: dotclear_user + MYSQL_PASSWORD: dotclear_pwd + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 + + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + volumes: + - dcstable/app:/var/www/dotclear + ports: + - 80:80 + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: mysqlimb4 + DC_DBHOST: dcstabledb + DC_DBNAME: dotclear_db + DC_DBUSER: dotclear_user + DC_DBPASSWORD: dotclear_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com + +volumes: + dcstable: \ No newline at end of file diff --git a/exemple/compose/volume/pgsql/docker-compose.yml b/exemple/compose/volume/pgsql/docker-compose.yml new file mode 100644 index 0000000..f7c12aa --- /dev/null +++ b/exemple/compose/volume/pgsql/docker-compose.yml @@ -0,0 +1,41 @@ +services: + + dcstabledb: + image: postgres + container_name: dcstabledb + restart: unless-stopped + environment: + POSTGRES_PASSWORD: dcstable_pwd + POSTGRES_USER: dcstable_user + POSTGRES_DB: dcstable_db + PGDATA: /var/lib/postgresql/data/pgdata + volumes: + - dcstable:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] + interval: 1s + timeout: 5s + retries: 10 + + dcstableapp: + image: jcpd/docker-dotclear:latest + container_name: dcstableapp + restart: unless-stopped + ports: + - 80:80 + volumes: + - dcstable/app:/var/www/dotclear + depends_on: + dcstabledb: + condition: service_healthy + environment: + DC_DBDRIVER: pgsql + DC_DBHOST: dcstabledb + DC_DBNAME: dcstable_db + DC_DBUSER: dcstable_user + DC_DBPASSWORD: dcstable_pwd + DC_DBPREFIX: dc_ + DC_ADMINMAILFROM: contact@exemple.com + +volumes: + dcstable: \ No newline at end of file diff --git a/exemple/compose/volume/sqlite/docker-compose.yml b/exemple/compose/volume/sqlite/docker-compose.yml index 0c424a3..869aeff 100644 --- a/exemple/compose/volume/sqlite/docker-compose.yml +++ b/exemple/compose/volume/sqlite/docker-compose.yml @@ -1,10 +1,10 @@ services: - dotclear: + dcstableapp: image: jcpd/docker-dotclear:latest - container_name: dotclear + container_name: dcstableapp restart: unless-stopped volumes: - - dotclear:/var/www/dotclear + - dcstable:/var/www/dotclear ports: - 80:80 environment: @@ -13,4 +13,4 @@ services: DC_ADMINMAILFROM: contact@exemple.com volumes: - dotclear: \ No newline at end of file + dcstable: \ No newline at end of file