From 9720f10038ebd5e718ed17faf7a8a8067474405d Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Thu, 8 Jun 2023 00:46:50 -0700 Subject: [PATCH] Fixed for Production and Staging --- README.md | 4 ++++ bin/setup_joomla_installer.sh | 2 +- docker-compose.staging.yml | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 35 ++++++++++------------------------- 4 files changed, 43 insertions(+), 26 deletions(-) create mode 100644 docker-compose.staging.yml diff --git a/README.md b/README.md index 1b5dd05..c903967 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ This repository hold all the information Nick has documented about Joomla. There are also helper files and scripts here. +[Quick Start Guide](https://git.nickyeoman.com/nick/joomla/wiki/Quick-Start) + * [Gitea Repo](https://git.nickyeoman.com/nick/joomla/) * [Wiki](https://git.nickyeoman.com/nick/joomla/wiki) +* [Issues](https://git.nickyeoman.com/nick/joomla/issues) + diff --git a/bin/setup_joomla_installer.sh b/bin/setup_joomla_installer.sh index 8afc1d2..1957e95 100644 --- a/bin/setup_joomla_installer.sh +++ b/bin/setup_joomla_installer.sh @@ -37,7 +37,7 @@ docker-compose exec -u www-data joomla php installation/joomla.php install \ --admin-username=$JOOMLA_USERNAME \ --admin-password=$JOOMLA_PASSWORD \ --db-type=mysqli \ - --db-host=mariadb \ + --db-host=mariadb-joomla \ --db-user=$MYSQL_USER \ --db-pass=$MYSQL_PASSWORD \ --db-name=$MYSQL_DATABASE \ diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml new file mode 100644 index 0000000..1e7a80c --- /dev/null +++ b/docker-compose.staging.yml @@ -0,0 +1,28 @@ +version: '3.8' + +services: + joomla: + ports: + - "8000:80" + + phpmyadmin: + image: phpmyadmin/phpmyadmin:latest # https://hub.docker.com/_/phpmyadmin + environment: + PMA_USER: ${MYSQL_USER} + PMA_PASSWORD: ${MYSQL_PASSWORD} + PMA_HOST: mariadb-joomla + UPLOAD_LIMIT: '200M' + ports: + - "8001:80" + volumes: + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + + mailhog: + image: 'mailhog/mailhog:latest' # https://hub.docker.com/r/mailhog/mailhog + ports: + - "${SMTP_PORT}:1025" + - "8002:8025" + volumes: + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" diff --git a/docker-compose.yml b/docker-compose.yml index eb4a298..d2d5d31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,13 @@ version: '3.8' +# For Staging +# docker-compose -f docker-compose.yml -f docker-compose.staging.yml --env-file .env.staging up -d +# docker-compose -f docker-compose.yml -f docker-compose.staging.yml --env-file .env.staging down +# +# For Production +# docker-compose up -d +# docker-compose down + volumes: joomla-db: joomla: @@ -10,7 +18,7 @@ networks: name: ${NETWORKNAME} services: - mariadb: + mariadb-joomla: image: mariadb:10.7.1 # https://hub.docker.com/_/mariadb restart: always environment: @@ -27,7 +35,7 @@ services: image: joomla:4.3.2 # https://hub.docker.com/_/joomla restart: always environment: - JOOMLA_DB_HOST: mariadb + JOOMLA_DB_HOST: mariadb-joomla JOOMLA_DB_USER: ${MYSQL_USER} JOOMLA_DB_PASSWORD: ${MYSQL_PASSWORD} JOOMLA_DB_NAME: ${MYSQL_DATABASE} @@ -37,27 +45,4 @@ services: - ./php/php.ini:/usr/local/etc/php/php.ini - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" - ports: - - "8000:80" - phpmyadmin: - image: phpmyadmin/phpmyadmin:latest # https://hub.docker.com/_/phpmyadmin - environment: - PMA_USER: ${MYSQL_USER} - PMA_PASSWORD: ${MYSQL_PASSWORD} - PMA_HOST: mariadb - UPLOAD_LIMIT: '200M' - ports: - - "8001:80" - volumes: - - "/etc/timezone:/etc/timezone:ro" - - "/etc/localtime:/etc/localtime:ro" - - mailhog: - image: 'mailhog/mailhog:latest' # https://hub.docker.com/r/mailhog/mailhog - ports: - - "${SMTP_PORT}:1025" - - "8002:8025" - volumes: - - "/etc/timezone:/etc/timezone:ro" - - "/etc/localtime:/etc/localtime:ro"