Docker: Difference between revisions

From SemanticOrganization
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Prerequisites ===
=== Prerequisites ===


Install [https://docs.docker.com/engine/install docker] and [https://docs.docker.com/compose/install/ docker-compose].
Install [https://docs.docker.com/engine/install docker] and [https://docs.docker.com/compose/install/ docker compose].


=== Installation ===
=== Installation ===


Create a <code>docker-compose.yml</code> file, use this template, change the variables according to your needs:
Create a <code>compose.yml</code> file, use this template, change the variables according to your needs:


<pre>
<pre>
version: '3.5'
volumes:  
volumes:  
   db:
   db:
   images:
   images:
   config:
   config:
#  custom:


services:
services:
Line 21: Line 20:
     environment:  
     environment:  
       - MYSQL_HOST=db
       - MYSQL_HOST=db
       - MYSQL_DATABASE=mediawiki
       - MYSQL_DATABASE=semorg
       - MYSQL_USER=mediawiki
       - MYSQL_USER=semorg
       - MYSQL_PASSWORD=secret
       - MYSQL_PASSWORD=<YOURDBPASSWORD>
       - MEDIAWIKI_LANG=en
       - MEDIAWIKI_LANG=en
       - MEDIAWIKI_ADMIN_USERNAME=admin
       - MEDIAWIKI_ADMIN_USERNAME=admin
       - MEDIAWIKI_ADMIN_PASSWORD=secretpassword
       - MEDIAWIKI_ADMIN_PASSWORD=<YOURADMINPASSWORD>
       - MEDIAWIKI_NAME=name
       - MEDIAWIKI_NAME=<YOURWIKINAME>
       - MEDIAWIKI_SERVER=https://your.server
       - MEDIAWIKI_SERVER=<YOURSERVER>
#      - MEDIAWIKI_DEBUG=true
#      - MEDIAWIKI_CUSTOM=true
     ports:
     ports:
       - "8081:80"
       - "8081:80"
Line 34: Line 35:
       - images:/var/www/html/images
       - images:/var/www/html/images
       - config:/var/www/html/config
       - config:/var/www/html/config
#      - custom:/var/www/html/extensions/SemanticOrganization/resources/custom
     depends_on:
     depends_on:
       - db
       - db
Line 46: Line 48:
       - db:/var/lib/mysql
       - db:/var/lib/mysql
     environment:
     environment:
       - MYSQL_ROOT_PASSWORD=secret
       - MARIADB_RANDOM_ROOT_PASSWORD=yes
       - MYSQL_DATABASE=mediawiki
       - MARIADB_DATABASE=semorg
       - MYSQL_USER=mediawiki
       - MARIADB_USER=semorg
       - MYSQL_PASSWORD=secret
       - MARIADB_PASSWORD=<YOURDBPASSWORD>
     logging:
     logging:
       options:
       options:
         max-size: 50m
         max-size: 50m
</pre>
</pre>
build and start container:
sudo docker-compose up -d


=== Additional Extensions ===
=== Additional Extensions ===
Line 69: Line 67:
* Semantic Organization
* Semantic Organization


To install additional extensions ...
To install additional extensions enter the container with <code>docker compose exec semorg bash</code> and create the file <code>/var/www/html/config/EXTENSIONS</code>. Add a line for every extension you would like to include. If the extension is hosted by MediaWiki it's enough to write the name of the extension, if not add the repository URL after a pipe:
 
SomeOfficialMediaWikiExtension
SomeUnofficialExtension|https://foreign.repo


=== Upgrading ===
=== Upgrading ===
Line 75: Line 76:
Update image:  
Update image:  


  sudo docker-compose pull
  sudo docker compose pull


Update skin and extensions:  
Update skin and extensions:  
Line 82: Line 83:
* other extensions (pull)
* other extensions (pull)


  sudo docker-compose exec semorg /update.sh
  sudo docker compose exec semorg /update.sh

Latest revision as of 08:31, 5 June 2024

Prerequisites

Install docker and docker compose.

Installation

Create a compose.yml file, use this template, change the variables according to your needs:

volumes: 
  db:
  images:
  config:
#  custom:

services:
  semorg:
    image: kollaborat/semorg:1.35
    restart: unless-stopped
    environment: 
      - MYSQL_HOST=db
      - MYSQL_DATABASE=semorg
      - MYSQL_USER=semorg
      - MYSQL_PASSWORD=<YOURDBPASSWORD>
      - MEDIAWIKI_LANG=en
      - MEDIAWIKI_ADMIN_USERNAME=admin
      - MEDIAWIKI_ADMIN_PASSWORD=<YOURADMINPASSWORD>
      - MEDIAWIKI_NAME=<YOURWIKINAME>
      - MEDIAWIKI_SERVER=<YOURSERVER>
#      - MEDIAWIKI_DEBUG=true
#      - MEDIAWIKI_CUSTOM=true
    ports:
      - "8081:80"
    volumes:
      - images:/var/www/html/images
      - config:/var/www/html/config
#      - custom:/var/www/html/extensions/SemanticOrganization/resources/custom
    depends_on:
      - db
    logging:
      options:
        max-size: 50m

  db:
    image: mariadb
    restart: unless-stopped
    volumes:
      - db:/var/lib/mysql
    environment:
      - MARIADB_RANDOM_ROOT_PASSWORD=yes
      - MARIADB_DATABASE=semorg
      - MARIADB_USER=semorg
      - MARIADB_PASSWORD=<YOURDBPASSWORD>
    logging:
      options:
        max-size: 50m

Additional Extensions

The Tweeki skin and the following extensions are included by default:

  • Semantic MediaWiki (via composer)
  • Semantic Result Formats (via composer)
  • Maps (via composer)
  • Page Forms
  • Semantic Organization

To install additional extensions enter the container with docker compose exec semorg bash and create the file /var/www/html/config/EXTENSIONS. Add a line for every extension you would like to include. If the extension is hosted by MediaWiki it's enough to write the name of the extension, if not add the repository URL after a pipe:

SomeOfficialMediaWikiExtension
SomeUnofficialExtension|https://foreign.repo

Upgrading

Update image:

sudo docker compose pull

Update skin and extensions:

  • Tweeki (pull)
  • SemanticOrganization (pull and page import)
  • other extensions (pull)
sudo docker compose exec semorg /update.sh