mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-03 18:36:22 +00:00
joomla_dev: rewrite stack with proper compose, sample.env, and README
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
# Joomla
|
||||
|
||||
## Overview
|
||||
|
||||
Joomla is a self-hosted content management system (CMS) for building websites and web applications. This Docker Compose stack deploys Joomla with a MariaDB database, persistent storage, and an external reverse proxy.
|
||||
|
||||
## Project Details
|
||||
|
||||
- **Project Repository:** [Joomla](https://www.joomla.org)
|
||||
- **Container Image:** [Docker Hub](https://hub.docker.com/_/joomla)
|
||||
- **Compose Example:** [Official Compose](https://hub.docker.com/_/joomla)
|
||||
- **Documentation:** [Joomla Docs](https://docs.joomla.org)
|
||||
- **Reverse Proxy Port:** `80`
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Copy `sample.env` to `.env` and edit the values (especially passwords)
|
||||
2. Start the stack: `docker compose up -d`
|
||||
3. Open http://localhost:8080 (or your proxy domain) in your browser
|
||||
4. If `JOOMLA_ADMIN_*` env vars are set, the installer is skipped and an admin user is created automatically. Otherwise, follow the web setup wizard.
|
||||
|
||||
## Environment Variable Notes
|
||||
|
||||
### Compose
|
||||
- `VOL_PATH` – base path for persistent data volumes (default: `/data`)
|
||||
- `JOOMLA_PORT` – host port for Joomla (default: `8080`)
|
||||
- `JOOMLA_IMAGE` – Joomla image tag (default: `joomla:5`)
|
||||
- `JOOMLA_RESTART` – container restart policy (default: `unless-stopped`)
|
||||
|
||||
### Database
|
||||
- `MARIADB_IMAGE` – MariaDB image tag (default: `mariadb:10.11`)
|
||||
- `MARIADB_ROOT_PASSWORD` – MariaDB root password (required)
|
||||
- `JOOMLA_DB_NAME` – database name (default: `joomla`)
|
||||
- `JOOMLA_DB_USER` – database user (default: `joomla`)
|
||||
- `JOOMLA_DB_PASSWORD` – database user password (required)
|
||||
|
||||
### Joomla Auto-Deployment
|
||||
- `JOOMLA_SITE_NAME` – site name displayed in Joomla
|
||||
- `JOOMLA_ADMIN_USER` – full name of the admin user
|
||||
- `JOOMLA_ADMIN_USERNAME` – admin login username (default: `admin`)
|
||||
- `JOOMLA_ADMIN_PASSWORD` – admin password (required, min 12 chars)
|
||||
- `JOOMLA_ADMIN_EMAIL` – admin email address
|
||||
|
||||
## Volume Notes
|
||||
|
||||
- `${VOL_PATH:-/data}/joomla/db` – MariaDB data files
|
||||
- `${VOL_PATH:-/data}/joomla/html` – Joomla web root (uploaded files, extensions, custom templates)
|
||||
|
||||
## Network Notes
|
||||
|
||||
Requires the external `proxy` network for reverse proxy access.
|
||||
|
||||
## Docker Run
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name joomla-mariadb \
|
||||
-e MARIADB_DATABASE=joomla \
|
||||
-e MARIADB_USER=joomla \
|
||||
-e MARIADB_PASSWORD=ChangeThisPassword \
|
||||
-e MARIADB_ROOT_PASSWORD=ChangeThisRootPassword \
|
||||
-v /data/joomla/db:/var/lib/mysql \
|
||||
mariadb:10.11
|
||||
```
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name joomla \
|
||||
-p 8080:80 \
|
||||
-e JOOMLA_DB_HOST=mariadb \
|
||||
-e JOOMLA_DB_USER=joomla \
|
||||
-e JOOMLA_DB_PASSWORD=ChangeThisPassword \
|
||||
-e JOOMLA_DB_NAME=joomla \
|
||||
-e JOOMLA_SITE_NAME="My Joomla Site" \
|
||||
-e JOOMLA_ADMIN_USER="Joomla Admin" \
|
||||
-e JOOMLA_ADMIN_USERNAME=admin \
|
||||
-e JOOMLA_ADMIN_PASSWORD=ChangeThisPassword \
|
||||
-e JOOMLA_ADMIN_EMAIL=admin@example.com \
|
||||
-v /data/joomla/html:/var/www/html \
|
||||
--link joomla-mariadb:mariadb \
|
||||
joomla:5
|
||||
```
|
||||
|
||||
## Additional Notes / Gotchas
|
||||
|
||||
- Setting `JOOMLA_ADMIN_*` env vars enables auto-deployment and skips the browser setup wizard. Remove them to run the wizard manually.
|
||||
- Admin password must be at least 12 characters long.
|
||||
- The `html` volume persists uploaded files and installed extensions. Back it up before major Joomla upgrades.
|
||||
- For SMTP configuration, add `JOOMLA_SMTP_HOST` and `JOOMLA_SMTP_HOST_PORT` environment variables.
|
||||
|
||||
## Dockhand Stack, Deploy from Git
|
||||
|
||||
Cookbooks Repository
|
||||
stackname: joomla
|
||||
Compose file path: joomla_dev/compose.yaml
|
||||
Additional env file (optional): joomla_dev/sample.env
|
||||
|
||||
Then "Load" joomla_dev/sample.env into the Environmental variables in dockhand
|
||||
|
||||
Create the Stack
|
||||
@@ -0,0 +1,41 @@
|
||||
services:
|
||||
mariadb:
|
||||
image: ${MARIADB_IMAGE:-mariadb:10.11}
|
||||
restart: ${JOOMLA_RESTART:-unless-stopped}
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/joomla/db:/var/lib/mysql
|
||||
environment:
|
||||
- MARIADB_DATABASE=${JOOMLA_DB_NAME:-joomla}
|
||||
- MARIADB_USER=${JOOMLA_DB_USER:-joomla}
|
||||
- MARIADB_PASSWORD=${JOOMLA_DB_PASSWORD:-ChangeThisPassword}
|
||||
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-ChangeThisRootPassword}
|
||||
networks:
|
||||
- internal
|
||||
|
||||
joomla:
|
||||
image: ${JOOMLA_IMAGE:-joomla:5}
|
||||
restart: ${JOOMLA_RESTART:-unless-stopped}
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/joomla/html:/var/www/html
|
||||
environment:
|
||||
- JOOMLA_DB_HOST=mariadb
|
||||
- JOOMLA_DB_USER=${JOOMLA_DB_USER:-joomla}
|
||||
- JOOMLA_DB_PASSWORD=${JOOMLA_DB_PASSWORD:-ChangeThisPassword}
|
||||
- JOOMLA_DB_NAME=${JOOMLA_DB_NAME:-joomla}
|
||||
- JOOMLA_SITE_NAME=${JOOMLA_SITE_NAME:-My Joomla Site}
|
||||
- JOOMLA_ADMIN_USER=${JOOMLA_ADMIN_USER:-Joomla Admin}
|
||||
- JOOMLA_ADMIN_USERNAME=${JOOMLA_ADMIN_USERNAME:-admin}
|
||||
- JOOMLA_ADMIN_PASSWORD=${JOOMLA_ADMIN_PASSWORD:-ChangeThisPassword}
|
||||
- JOOMLA_ADMIN_EMAIL=${JOOMLA_ADMIN_EMAIL:-admin@example.com}
|
||||
ports:
|
||||
- "${JOOMLA_PORT:-8080}:80"
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
depends_on:
|
||||
- mariadb
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
internal:
|
||||
@@ -1,67 +0,0 @@
|
||||
# Recommended .env file
|
||||
#
|
||||
# # Docker
|
||||
# NETWORKNAME=admin_web
|
||||
# # MySQL
|
||||
# MYSQL_ROOT_PASSWORD=ChangeMe!
|
||||
# MYSQL_USER=ChangeMe!
|
||||
# MYSQL_PASSWORD=ChangeMe!
|
||||
# MYSQL_DATABASE=ChangeMe!
|
||||
# # GITEA
|
||||
# GITEA_API_URL=http://giteaDomain.com/api/v1
|
||||
# ACCESS_TOKEN=ChangeMe!
|
||||
# # Joomla
|
||||
# EMAIL=info@example.com
|
||||
# JOOMLA_USER="ChangeMe!"
|
||||
# JOOMLA_USERNAME=ChangeMe!
|
||||
# # Passwords must be 12 characters long (admin-password)
|
||||
# JOOMLA_PASSWORD=ChangeMe!123
|
||||
# # SMTP
|
||||
# SMTP_USER=null
|
||||
# SMTP_PASS=null
|
||||
# SMTP_HOST='mailhog'
|
||||
# SMTP_SECURITY='None'
|
||||
# SMTP_PORT=1025
|
||||
# # PRODUCTION
|
||||
# PRODUCTION=cow.nickyeoman.com
|
||||
|
||||
volumes:
|
||||
joomla-db:
|
||||
#joomla:
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: ${NETWORKNAME}
|
||||
|
||||
services:
|
||||
|
||||
mariadb-joomla:
|
||||
image: mariadb:10.7.1 # https://hub.docker.com/_/mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_USER: ${MYSQL_USER}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
volumes:
|
||||
- joomla-db:/var/lib/mysql
|
||||
- "/etc/timezone:/etc/timezone:ro"
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
|
||||
joomla:
|
||||
image: joomla:4.3.3 # https://hub.docker.com/_/joomla
|
||||
restart: always
|
||||
environment:
|
||||
JOOMLA_DB_HOST: mariadb-joomla
|
||||
JOOMLA_DB_USER: ${MYSQL_USER}
|
||||
JOOMLA_DB_PASSWORD: ${MYSQL_PASSWORD}
|
||||
JOOMLA_DB_NAME: ${MYSQL_DATABASE}
|
||||
volumes:
|
||||
#- joomla:/var/www/html
|
||||
- ./html:/var/www/html
|
||||
- ./php/php.ini:/usr/local/etc/php/php.ini
|
||||
- "/etc/timezone:/etc/timezone:ro"
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
links:
|
||||
- mariadb-joomla
|
||||
@@ -0,0 +1,21 @@
|
||||
# Compose
|
||||
VOL_PATH=/data
|
||||
JOOMLA_PORT=8080
|
||||
JOOMLA_IMAGE=joomla:5
|
||||
JOOMLA_RESTART=unless-stopped
|
||||
|
||||
# MariaDB
|
||||
MARIADB_IMAGE=mariadb:10.11
|
||||
MARIADB_ROOT_PASSWORD=ChangeThisRootPassword
|
||||
|
||||
# Joomla Database
|
||||
JOOMLA_DB_NAME=joomla
|
||||
JOOMLA_DB_USER=joomla
|
||||
JOOMLA_DB_PASSWORD=ChangeThisPassword
|
||||
|
||||
# Joomla Auto-Deployment (skips browser setup wizard)
|
||||
JOOMLA_SITE_NAME=My Joomla Site
|
||||
JOOMLA_ADMIN_USER=Joomla Admin
|
||||
JOOMLA_ADMIN_USERNAME=admin
|
||||
JOOMLA_ADMIN_PASSWORD=ChangeThisPassword
|
||||
JOOMLA_ADMIN_EMAIL=admin@example.com
|
||||
Reference in New Issue
Block a user