Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joomla Update #2462

Merged
merged 6 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions joomla/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,45 @@ Joomla is a free and open-source content management system (CMS) for publishing
# How to use this image

```console
$ docker run --name some-%%REPO%% --link some-mysql:mysql -d %%IMAGE%%
$ docker run --name some-%%REPO%% --network some-network -d %%IMAGE%%
Llewellynvdm marked this conversation as resolved.
Show resolved Hide resolved
```

The following environment variables are also honored for configuring your Joomla instance:
The following environment variables are honored for configuring your Joomla instance:

- `-e JOOMLA_DB_HOST=...` (defaults to the IP and port of the linked `mysql` container)
- `-e JOOMLA_DB_USER=...` (defaults to "root")
- `-e JOOMLA_DB_PASSWORD=...` (defaults to the value of the `MYSQL_ROOT_PASSWORD` environment variable from the linked `mysql` container)
- `-e JOOMLA_DB_NAME=...` (defaults to "joomla")
- `-e JOOMLA_DB_HOST=...` (defaults to the IP and port of the linked `mysql` container)
- `-e JOOMLA_DB_USER=...` (defaults to "root")
- `-e JOOMLA_DB_PASSWORD=...` (defaults to the value of the `MYSQL_ROOT_PASSWORD` environment variable from the linked `mysql` container)
- `-e JOOMLA_DB_PASSWORD_FILE=...` (path to a file containing the database password)
- `-e JOOMLA_DB_NAME=...` (defaults to "joomla")
- `-e JOOMLA_DB_TYPE=...` (defaults to "mysqli" options: mysqli, pgsql)

If the `JOOMLA_DB_NAME` specified does not already exist on the given MySQL server, it will be created automatically upon startup of the `%%REPO%%` container, provided that the `JOOMLA_DB_USER` specified has the necessary permissions to create it.

The following environment variables are also honored for configuring auto deployment (skip the browser setup) for your Joomla instance:

- `-e JOOMLA_SITE_NAME=...` (name of the Joomla site)
- `-e JOOMLA_ADMIN_USER=...` (full name of the Joomla administrator)
- `-e JOOMLA_ADMIN_USERNAME=...` (username of the Joomla administrator)
- `-e JOOMLA_ADMIN_PASSWORD=...` (password of the Joomla administrator)
- `-e JOOMLA_ADMIN_EMAIL=...` (email address of the Joomla administrator)
- `-e JOOMLA_EXTENSIONS_URLS=...` (semicolon-separated list of URLs to install Joomla extensions from)
- `-e JOOMLA_EXTENSIONS_PATHS=...` (semicolon-separated list of file paths to install Joomla extensions from)
- `-e JOOMLA_SMTP_HOST=...` (SMTP host for outgoing email)
- `-e JOOMLA_SMTP_HOST_PORT=...` (SMTP port for outgoing email)

If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used:

```console
$ docker run --name some-%%REPO%% --link some-mysql:mysql -p 8080:80 -d %%IMAGE%%
$ docker run --name some-%%REPO%% --network some-network -p 8080:80 -d %%IMAGE%%
```

Then, access it via `http://localhost:8080` or `http://host-ip:8080` in a browser.

If you'd like to use an external database instead of a linked `mysql` container, specify the hostname and port with `JOOMLA_DB_HOST` along with the password in `JOOMLA_DB_PASSWORD` and the username in `JOOMLA_DB_USER` (if it is something other than `root`):
If you'd like to use an external database instead of a MySQL container, specify the hostname and port with `JOOMLA_DB_HOST` along with the password in `JOOMLA_DB_PASSWORD` and the username in `JOOMLA_DB_USER` (if it is something other than `root`):

```console
$ docker run --name some-%%REPO%% -e JOOMLA_DB_HOST=10.1.2.3:3306 \
-e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%REPO%%
$ docker run --name some-%%REPO%% --network some-network -e JOOMLA_DB_HOST=10.1.2.3:3306 \
-e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%IMAGE%%
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be %%REPO%% or %%IMAGE%%

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be %%IMAGE%% and is an excellent catch we clearly missed previously! 😄

```

## %%STACK%%
Expand All @@ -44,7 +58,7 @@ Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml

This image does not provide any additional PHP extensions or other libraries, even if they are required by popular plugins. There are an infinite number of possible plugins, and they potentially require any extension PHP supports. Including every PHP extension that exists would dramatically increase the image size.

If you need additional PHP extensions, you'll need to create your own image `FROM` this one. The [documentation of the `php` image](https://github.com/docker-library/docs/blob/master/php/README.md#how-to-install-more-php-extensions) explains how to compile additional extensions. Additionally, the [`%%REPO%%` Dockerfile](https://github.com/joomla/docker-joomla/blob/966275ada2148e343a68c8c03870f11cc7f5b89c/apache/Dockerfile#L7-L11) has an example of doing this.
If you need additional PHP extensions, you'll need to create your own image `FROM` this one. The [documentation of the `php` image](https://github.com/docker-library/docs/blob/master/php/README.md#how-to-install-more-php-extensions) explains how to compile additional extensions. Additionally, the [`%%REPO%%` Dockerfile](https://github.com/joomla-docker/docker-joomla/blob/360f6bd96c80f72b020d2d9c8aae9daa6bca2887/5.1/php8.3/apache/Dockerfile#L51-L64) has an example of doing this.

The following Docker Hub features can help with the task of keeping your dependent images up-to-date:

Expand Down
2 changes: 1 addition & 1 deletion joomla/github-repo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/joomla/docker-joomla
https://github.com/joomla-docker/docker-joomla
38 changes: 30 additions & 8 deletions joomla/stack.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
version: '3.1'

services:

joomla:
image: joomla
restart: always
links:
- joomladb:mysql
ports:
- 8080:80
environment:
JOOMLA_DB_HOST: joomladb
JOOMLA_DB_PASSWORD: example
JOOMLA_DB_HOST: db
JOOMLA_DB_USER: joomla
JOOMLA_DB_PASSWORD: examplepass
JOOMLA_DB_NAME: joomla_db
JOOMLA_SITE_NAME: Joomla
JOOMLA_ADMIN_USER: Joomla Hero
JOOMLA_ADMIN_USERNAME: joomla
JOOMLA_ADMIN_PASSWORD: joomla@secured
JOOMLA_ADMIN_EMAIL: joomla@example.com
volumes:
- joomla_data:/var/www/html
networks:
- joomla_network
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I also change this to some-network or is this okay?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably fine since it's self-contained in an example file that does create the network also.


joomladb:
db:
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: joomla_db
MYSQL_USER: joomla
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db_data:/var/lib/mysql
networks:
- joomla_network

volumes:
joomla_data:
db_data:

networks:
joomla_network: