Aller au contenu

08 Piwigo

Piwigo

https://hub.docker.com/r/mathieuruellan/piwigo

Dans répertoire ~/home/piwigo/ créer le fichier docker-compose.yml puis lancer la commande $ docker-compose up -d

mysqlpiwigo:
   image: mariadb:latest
   volumes:
      - /home/mathgon/piwigo/mysql/:/var/lib/mysql
   environment:
      - MYSQL_ROOT_PASSWORD=e@69
      - MYSQL_DATABASE=piwigo
      - MYSQL_USER=piwigo
      - MYSQL_PASSWORD=e@69
piwigo:
   image: mathieuruellan/piwigo
   links:
      - mysqlpiwigo:mysql
   volumes:
      - /home/mathgon/data/Photos:/var/www/galleries
      - /home/mathgon/piwigo/data/local:/var/www/local
      - /home/mathgon/piwigo/data/plugins:/var/www/plugins
      - /home/mathgon/piwigo/data/themes:/var/www/themes
      - /home/mathgon/piwigo/cache:/var/www/_data/i
      - /home/mathgon/piwigo/upload:/var/www/upload
      - /var/log
      - /var/log/piwigo:/var/log/apache2
   ports:
      - "21212:80"
   hostname: piwigo
   domainname: MYDOMAIN.COM

Crée automatiquement les sous-répertoires cache, data mysql et upload

After db initialization (first launch), environment variables can me removed.

Mkdocs as a service

sudo nano /etc/systemd/system/piwigo.service

[Unit]
Description=Piwigo

[Service]
Type=simple
ExecStart=/home/mathgon/piwigo/docker-compose up -d
#User=mathgon
#Group=mathgon
Restart=always
RestartSec=10

Executer les commandes

systemctl enable piwigo.service
systemctl daemon-reload
systemctl restart piwigo.service
Vérifier l'état du service

sudo service piwigo status

Précédente version

https://hub.docker.com/r/linuxserver/piwigo

Site à manipulation / Déplacement, corruption de la db et plus moyen de réinstaller le container. Remplacé par la version ci-dessus

version: "2.1" services: db: image: linuxserver/mariadb:latest restart: always container_name: piwi_db environment: - MYSQL_ROOT_PASSWORD=asdfasdf - MYSQL_USER=piwigouser - MYSQL_PASSWORD=asdfasdf - MYSQL_DATABASE=piwigo volumes: - /home/hostcomputeruser/Docker/piwigo/db:/var/lib/mysql app: image: linuxserver/piwigo container_name: piwi_app environment: - PUID=1000 - PGID=1000 - TZ=Europe/Paris volumes: - /home/mathgon/piwigo/config:/config - /home/mathgon/piwigo/gallery:/gallery - /home/mathgon/data/Photos:/pictures ports: - 21212:80 restart: unless-stopped

Save the yaml into a docker-compose.yml file and run sudo docker-compose up -d from the same directory. Browse to http://localhost:21212 13 for the setup and enter:

db for Host (service_name defined in the docker-compose file)
piwigo for User (MYSQL_USER defined in compose)
asdfasdf for Password (MYSQL_PASSWORD)
piwigo for Database name (MYSQL_DATABASE)
piwigo_ for Database tables prefix (filled in already)