Piwigo - オープンソースの写真管理 Web アプリ
前提条件
詳しくは Podman - ローカル環境からコンテナと Kubernetes をシームレスに操作 を参照…🤔
以降の手順の実行には、Podman および podman compose の実行環境が必要である😉
コンテナの起動
ディレクトリ作成…🤔
$ mkdir -p piwigo/{config/{piwigo,marinadb,phpmyadmin},gallery} && cd piwigo
podman compose の定義…🤔
$ cat << EOF > docker-compose.yml
services: piwigo: hostname: piwigo image: linuxserver/piwigo ports: - 8080:80 volumes: - "./config/piwigo:/config" - "./gallery:/gallery" environment: PUID: 1000 PGID: 1000 phpmyadmin: hostname: phpmyadmin image: linuxserver/phpmyadmin ports: - 8081:80 volumes: - "./config/phpmyadmin:/config" environment: PUID: 1000 PGID: 1000 PMA_HOST: piwigo-mariadb mariadb: hostname: piwigo-mariadb image: linuxserver/mariadb volumes: - "./config/mariadb:/config" environment: PUID: 1000 PGID: 1000 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD}
podman compose の環境変数を定義…🤔
$ cat << EOF > .env
TimeZone=Asia/Tokyo MYSQL_ROOT_PASSWORD=piwigo596! MYSQL_DATABASE=piwigo_db MYSQL_USER=piwigo MYSQL_PASSWORD=piwigo EOF
ルートレス サービスのユーザー systemd ソケットを開始する…🤔
公式: podman-system-service — Podman documentation
$ systemctl --user start podman.socket $ export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
podman compose でコンテナを起動…🤔
$ podman compose up
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please refer to the documentation for details. <<<< [+] Running 19/19 ✔ phpmyadmin Pulled 52.7s ✔ d0b986aaa0c9 Download complete 19.1s ✔ d48dba489a7d Download complete 3.1s ✔ 9ca7e1a6de9f Download complete 0.2s ✔ 26304747ec45 Download complete 43.3s ✔ 561c678d67ce Download complete 0.2s ✔ mariadb Pulled 47.5s ✔ 4f59135d714f Download complete 36.5s ✔ 1c50a76b3d41 Download complete 2.0s ✔ 069593985fd7 Download complete 37.8s ✔ d555b37a7536 Download complete 0.2s ✔ 5dc7ed07e470 Download complete 3.2s ✔ 6c0d85d774e7 Download complete 39.2s ✔ cd947977bea5 Download complete 0.2s ✔ piwigo Pulled 78.3s ✔ a9c38e3bb148 Download complete 2.0s ✔ 94de7a10d56a Download complete 67.6s ✔ bb84632e2b8a Download complete 0.3s ✔ aff84eb5d1f1 Download complete 0.2s [+] Running 4/4 ✔ Network piwigo_default Created 0.0s ✔ Container piwigo-mariadb-1 Created 0.7s ✔ Container piwigo-phpmyadmin-1 Created 0.7s ✔ Container piwigo-piwigo-1 Created 0.8s Attaching to mariadb-1, phpmyadmin-1, piwigo-1 piwigo-1 | [migrations] started piwigo-1 | [migrations] 01-nginx-site-confs-default: executing... piwigo-1 | [migrations] 01-nginx-site-confs-default: succeeded piwigo-1 | [migrations] done phpmyadmin-1 | [migrations] started phpmyadmin-1 | [migrations] 01-nginx-site-confs-default: executing... phpmyadmin-1 | [migrations] 01-nginx-site-confs-default: succeeded phpmyadmin-1 | [migrations] 02-default-location: executing... phpmyadmin-1 | [migrations] 02-default-location: succeeded phpmyadmin-1 | [migrations] done mariadb-1 | [migrations] started mariadb-1 | [migrations] no migrations found piwigo-1 | ─────────────────────────────────────── piwigo-1 | piwigo-1 | ██╗ ███████╗██╗ ██████╗ piwigo-1 | ██║ ██╔════╝██║██╔═══██╗ piwigo-1 | ██║ ███████╗██║██║ ██║ piwigo-1 | ██║ ╚════██║██║██║ ██║ piwigo-1 | ███████╗███████║██║╚██████╔╝ piwigo-1 | ╚══════╝╚══════╝╚═╝ ╚═════╝ piwigo-1 | piwigo-1 | Brought to you by linuxserver.io piwigo-1 | ─────────────────────────────────────── piwigo-1 | piwigo-1 | To support LSIO projects visit: piwigo-1 | https://www.linuxserver.io/donate/ piwigo-1 | piwigo-1 | ─────────────────────────────────────── piwigo-1 | GID/UID piwigo-1 | ─────────────────────────────────────── piwigo-1 | piwigo-1 | User UID: 1000 piwigo-1 | User GID: 1000 piwigo-1 | ─────────────────────────────────────── piwigo-1 | piwigo-1 | Setting resolver to 10.89.0.1 piwigo-1 | Setting worker_processes to 4 phpmyadmin-1 | ─────────────────────────────────────── phpmyadmin-1 | phpmyadmin-1 | ██╗ ███████╗██╗ ██████╗ phpmyadmin-1 | ██║ ██╔════╝██║██╔═══██╗ phpmyadmin-1 | ██║ ███████╗██║██║ ██║ phpmyadmin-1 | ██║ ╚════██║██║██║ ██║ phpmyadmin-1 | ███████╗███████║██║╚██████╔╝ phpmyadmin-1 | ╚══════╝╚══════╝╚═╝ ╚═════╝ phpmyadmin-1 | phpmyadmin-1 | Brought to you by linuxserver.io phpmyadmin-1 | ─────────────────────────────────────── phpmyadmin-1 | phpmyadmin-1 | To support LSIO projects visit: phpmyadmin-1 | https://www.linuxserver.io/donate/ phpmyadmin-1 | phpmyadmin-1 | ─────────────────────────────────────── phpmyadmin-1 | GID/UID phpmyadmin-1 | ─────────────────────────────────────── phpmyadmin-1 | phpmyadmin-1 | User UID: 1000 phpmyadmin-1 | User GID: 1000 phpmyadmin-1 | ─────────────────────────────────────── phpmyadmin-1 | piwigo-1 | generating self-signed keys in /config/keys, you can replace these with your own keys if required mariadb-1 | ─────────────────────────────────────── mariadb-1 | mariadb-1 | ██╗ ███████╗██╗ ██████╗ mariadb-1 | ██║ ██╔════╝██║██╔═══██╗ mariadb-1 | ██║ ███████╗██║██║ ██║ mariadb-1 | ██║ ╚════██║██║██║ ██║ mariadb-1 | ███████╗███████║██║╚██████╔╝ mariadb-1 | ╚══════╝╚══════╝╚═╝ ╚═════╝ mariadb-1 | mariadb-1 | Brought to you by linuxserver.io mariadb-1 | ─────────────────────────────────────── mariadb-1 | mariadb-1 | To support LSIO projects visit: mariadb-1 | https://www.linuxserver.io/donate/ mariadb-1 | mariadb-1 | ─────────────────────────────────────── mariadb-1 | GID/UID mariadb-1 | ─────────────────────────────────────── mariadb-1 | mariadb-1 | User UID: 1000 mariadb-1 | User GID: 1000 mariadb-1 | ─────────────────────────────────────── mariadb-1 | piwigo-1 | .......+......+.....+++++++++++++++++++++++++++++++++++++++*..+......+.......+..+.+...........+.+............+...+.........+...+++++++++++++++++++++++++++++++++++++++*......+....+...........+.+.........+............+..+...+...+....+............+..............+......+.+...+.........+......+............+........+.+...+..+.+.................+.+......+...+........+....+...+..+....+..+...+....+......+......+........+...+...+.+......+..+.....................+.+..............+.+........+..........+..+.+...+.....+....+......++++++ phpmyadmin-1 | Setting resolver to 10.89.0.1 phpmyadmin-1 | Setting worker_processes to 4 phpmyadmin-1 | generating self-signed keys in /config/keys, you can replace these with your own keys if required piwigo-1 | ..+......+.........+++++++++++++++++++++++++++++++++++++++*.+..+.+++++++++++++++++++++++++++++++++++++++*...+.....+......+............+..................+....+..................+.................+....+............+.....+...+......+....+..+...+.........+.......+........+.............+..+.+..+.........+...+.+.....+..........+...........+.+..+.......+...+..+.+........+..........+..+.............+.....+.+...+...+...+......+.....++++++ piwigo-1 | ----- mariadb-1 | Setting Up Initial Databases mariadb-1 | Installing MariaDB/MySQL system tables in '/config/databases' ... phpmyadmin-1 | ...+..+.......+...+++++++++++++++++++++++++++++++++++++++*.+.....+......+...+.+..............+++++++++++++++++++++++++++++++++++++++*......+.........+.....+....+..............+...+.......+..+.+..............+.....................+....+...+........+...+....+......+.....+..........+..+...+....+..+.+..+......+.+....................+...+...+....+.........+..............+.+..+...++++++ phpmyadmin-1 | .+..............+...+....+...+..+...+.......+........+.+............+.....+.........+++++++++++++++++++++++++++++++++++++++*.....+..+++++++++++++++++++++++++++++++++++++++*...........+..........+........+......+......+...+...............+.+...+..+.........+...................+.....+.......+......+...+......+.....+.+..+.+...............+.....+......+.+........+......+.............+.....+.......+...+......+..+.......+...+...+..+.............+...............+.....+.......+..+......+............+..........+.........+.....+....+............+..+.+..+..........+.................+...+....+...+...+........+....+..+....+..+.......+.....+............+.........+....+........+.........+.+..+.+...........+.+..............+...+......+.......+.....+...+.......+.........+.........+..+............+...+...+.......+.........+.........+..............+............+......+...+......+.+..+..........+.....+.+..+...+.+...+.....+.......+.....+...+......+......+......+..........+..............+.+.....+.......+...+...+..+....+...+..+.........+....+...+...+.....+.......+........+.........+.+......++++++ phpmyadmin-1 | ----- mariadb-1 | 2024-05-15 21:20:13 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory") phpmyadmin-1 | [custom-init] No custom files found, skipping... phpmyadmin-1 | [ls.io-init] done. piwigo-1 | [custom-init] No custom files found, skipping... piwigo-1 | [ls.io-init] done. mariadb-1 | OK mariadb-1 | mariadb-1 | To start mariadbd at boot time you have to copy mariadb-1 | support-files/mariadb.service to the right place for your system mariadb-1 | mariadb-1 | mariadb-1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! mariadb-1 | To do so, start the server, then issue the following command: mariadb-1 | mariadb-1 | '/usr/bin/mariadb-secure-installation' mariadb-1 | mariadb-1 | which will also give you the option of removing the test mariadb-1 | databases and anonymous user created by default. This is mariadb-1 | strongly recommended for production servers. mariadb-1 | mariadb-1 | See the MariaDB Knowledgebase at https://mariadb.com/kb mariadb-1 | mariadb-1 | You can start the MariaDB daemon with: mariadb-1 | cd '/usr' ; /usr/bin/mariadb-safe --datadir='/config/databases' mariadb-1 | mariadb-1 | You can test the MariaDB daemon with mysql-test-run.pl mariadb-1 | cd '/usr/mysql-test' ; perl mariadb-test-run.pl mariadb-1 | mariadb-1 | Please report any problems at https://mariadb.org/jira mariadb-1 | mariadb-1 | The latest information about MariaDB is available at https://mariadb.org/. mariadb-1 | mariadb-1 | Consider joining MariaDB's strong and vibrant community: mariadb-1 | https://mariadb.org/get-involved/ mariadb-1 | mariadb-1 | 2024-05-15 21:20:46 0 [Note] Starting MariaDB 10.11.6-MariaDB-log source revision fecd78b83785d5ae96f2c6ff340375be803cd299 as process 185 mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Compressed tables use zlib 1.3.1 mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Number of transaction pools: 1 mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions mariadb-1 | 2024-05-15 21:20:46 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts) mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Using Linux native AIO mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Initializing buffer pool, total size = 256.000MiB, chunk size = 4.000MiB mariadb-1 | 2024-05-15 21:20:46 0 [Note] InnoDB: Completed initialization of buffer pool mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: Buffered log writes (block size=512 bytes) mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: End of log at LSN=46846 mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: 128 rollback segments are active. mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ... mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB. mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: log sequence number 46846; transaction id 14 mariadb-1 | 2024-05-15 21:20:47 0 [Note] Plugin 'FEEDBACK' is disabled. mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool mariadb-1 | 2024-05-15 21:20:47 0 [Note] InnoDB: Buffer pool(s) load completed at 240515 21:20:47 mariadb-1 | 2024-05-15 21:20:47 0 [Note] Server socket created on IP: '0.0.0.0'. mariadb-1 | 2024-05-15 21:20:47 0 [Note] Server socket created on IP: '::'. mariadb-1 | 2024-05-15 21:20:48 0 [Note] mariadbd: ready for connections. mariadb-1 | Version: '10.11.6-MariaDB-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Alpine Linux mariadb-1 | 2024-05-15 21:20:49 0 [Note] mariadbd (initiated by: root[root] @ localhost []): Normal shutdown mariadb-1 | 2024-05-15 21:20:49 0 [Note] InnoDB: FTS optimize thread exiting. mariadb-1 | 2024-05-15 21:20:50 0 [Note] InnoDB: Starting shutdown... mariadb-1 | 2024-05-15 21:20:50 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool mariadb-1 | 2024-05-15 21:20:50 0 [Note] InnoDB: Buffer pool(s) dump completed at 240515 21:20:50 mariadb-1 | 2024-05-15 21:20:50 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1" mariadb-1 | 2024-05-15 21:20:50 0 [Note] InnoDB: Shutdown completed; log sequence number 46846; transaction id 16 mariadb-1 | 2024-05-15 21:20:50 0 [Note] mariadbd: Shutdown complete mariadb-1 | mariadb-1 | Database Setup Completed mariadb-1 | [custom-init] No custom files found, skipping... mariadb-1 | 240515 21:20:51 mysqld_safe Logging to '/config/databases/piwigo-mariadb.err'. mariadb-1 | 240515 21:20:51 mysqld_safe Starting mariadbd daemon with databases from /config/databases mariadb-1 | Connection to localhost (::1) 3306 port [tcp/mysql] succeeded! mariadb-1 | [ls.io-init] done.
インストールと動作確認
http://localhost:8080/ にアクセスして、Piwigo のインストールを済ませる…😉