Add MediaWiki container to webserver stack

This commit is contained in:
Kris Lamoureux 2025-06-29 21:38:53 -04:00
parent bda79d0b37
commit efd29c08fb
Signed by: kris
GPG Key ID: 105B748C1362EB96
3 changed files with 46 additions and 8 deletions

View File

@ -13,18 +13,21 @@ and services operated by Free I.T. Athens (FRITA).
- [Traefik Dashboard](https://traefik.local.freeitathens.org:9443/dashboard/#/)
- [WordPress](https://www.local.freeitathens.org)
- [Nextcloud](https://cloud.local.freeitathens.org)
- [Mediawiki](https://wiki.local.freeitathens.org)
4. Click through the HTTPS security warning
## Production
1. Clone [production-env](https://github.com/freeitathens/production-env/) to `./environments`
1. Clone [production-env](https://github.com/freeitathens/production-env/) to
`./environments`
```
mkdir -p environments
git clone git@github.com:freeitathens/production-env.git ./environments
```
2. Run `./scripts/vault-key.sh` from the root of the project to obtain the Ansible Vault password
2. Run `./scripts/vault-key.sh` from the root of the project to obtain the
Ansible Vault password
3. Enter the Bitwarden Master Password
4. Run `ansible-playbook` against the production servers, e.g.,
@ -51,11 +54,13 @@ To submit, press `CTRL+d` twice.
ansible-vault encrypt --vault-pass-file .ansible_vault
```
- e.g., `pwgen -s 100 1 | ansible-vault encrypt --vault-pass-file .ansible_vault`
- e.g.,
`pwgen -s 100 1 | ansible-vault encrypt --vault-pass-file .ansible_vault`
## Authors
- **Kris Lamoureux** - _Project Founder_ - [@krislamo](https://github.com/krislamo)
- **Kris Lamoureux** - _Project Founder_ -
[@krislamo](https://github.com/krislamo)
## Copyrights and Licenses
@ -65,9 +70,9 @@ This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

View File

@ -7,6 +7,7 @@ secret:
WORDPRESS_DB_PASSWORD: WPpa55w0rd!
NEXTCLOUD_MYSQL_PASSWORD: NCdbpa55w0rd!
NEXTCLOUD_ADMIN_PASSWORD: NCadm1npa55w0rd!
MEDIAWIKI_MYSQL_PASSWORD: MWdbpa55w0rd!
##############
### Common ###
@ -26,6 +27,8 @@ databases:
pass: "{{ secret.WORDPRESS_DB_PASSWORD }}"
- name: nextcloud
pass: "{{ secret.NEXTCLOUD_MYSQL_PASSWORD }}"
- name: mediawiki
pass: "{{ secret.MEDIAWIKI_MYSQL_PASSWORD }}"
#######################
### Webserver Stack ###
@ -69,3 +72,9 @@ webserver:
# NEXTCLOUD_ADMIN: admin
NEXTCLOUD_ADMIN_PASSWORD: "{{ secret.NEXTCLOUD_ADMIN_PASSWORD }}"
NEXTCLOUD_MYSQL_PASSWORD: "{{ secret.NEXTCLOUD_MYSQL_PASSWORD }}"
#################
### MediaWiki ###
#################
# MEDIAWIKI_VERSION: stable
# MEDIAWIKI_DOMAIN: wiki.local.freeitathens.org

View File

@ -1,6 +1,7 @@
volumes:
wordpress:
nextcloud:
mediawiki:
networks:
traefik:
@ -60,7 +61,9 @@ services:
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
labels:
traefik.http.routers.wordpress.rule: Host(`${WORDPRESS_DOMAIN:-www.local.freeitathens.org}`) || Host(`${TRAEFIK_ACME_DOMAIN_MAIN:-local.freeitathens.org}`)
traefik.http.routers.wordpress.rule:
Host(`${WORDPRESS_DOMAIN:-www.local.freeitathens.org}`) ||
Host(`${TRAEFIK_ACME_DOMAIN_MAIN:-local.freeitathens.org}`)
traefik.http.routers.wordpress.entrypoints: websecure
traefik.http.routers.wordpress.middlewares: "wwwredirect"
traefik.http.routers.wordpress.tls: true
@ -108,3 +111,24 @@ services:
- traefik
extra_hosts:
- host.docker.internal:host-gateway
mediawiki:
image: ${MEDIAWIKI_IMAGE:-docker.io/library/mediawiki}:${MEDIAWIKI_VERSION:-stable}
restart: always
labels:
traefik.http.routers.mediawiki.rule: "Host(`${MEDIAWIKI_DOMAIN:-wiki.local.freeitathens.org}`)"
traefik.http.routers.mediawiki.entrypoints: websecure
traefik.http.routers.mediawiki.tls: true
traefik.http.routers.mediawiki.tls.certresolver: letsencrypt
traefik.http.routers.mediawiki.tls.domains[0].main: ${TRAEFIK_ACME_DOMAIN_MAIN:-local.freeitathens.org}
traefik.http.routers.mediawiki.tls.domains[0].sans: "${TRAEFIK_ACME_DOMAIN_SANS:-*.local.freeitathens.org}"
traefik.http.services.mediawiki.loadbalancer.server.port: 80
traefik.docker.network: traefik
traefik.enable: ${MEDIAWIKI_WEB_ENABLED:-true}
volumes:
- ./LocalSettings.php:/var/www/html/LocalSettings.php
- mediawiki:/var/www/html/images
networks:
- traefik
extra_hosts:
- host.docker.internal:host-gateway