
piwigo/piwigo!Piwigo
An alpine based container to easily deploy piwigo !
networks: piwigo-network: external: false services: piwigo-main: image: piwigo/piwigo:latest restart: always environment: - TZ=${timezone} networks: - piwigo-network ports: - ${piwigo_port}:80 depends_on: - piwigo-db volumes: - ./piwigo-data/piwigo:/var/www/html/piwigo/ - ./piwigo-data/scripts:/usr/local/bin/scripts/ piwigo-db: image: docker.io/library/mariadb:lts restart: always environment: - MARIADB_RANDOM_ROOT_PASSWORD=true - MARIADB_USER=piwigodb_user - MARIADB_DATABASE=piwigodb # Defined in .env - MARIADB_PASSWORD=${db_user_password} - TZ=${timezone} networks: - piwigo-network volumes: - ./piwigo-data/mysql:/var/lib/mysql
Create a folder named Piwigo and copy compose.yaml from this repository, then create a .env file
Piwigo ├── .env └── compose.yaml
Edit the .env and add a password after db_user_password= (you can generate a strong password here). Change the exposed port if you need to. And you can also set a timezone.
db_user_password= piwigo_port=8080 timezone=Europe/Paris
Start the container with docker compose up -d
Setup your reverse proxy to have a domain/subdomain or subpath point to the container. The following examples are for nginx :
server { listen 80; server_name my_domain.tld; location / { proxy_pass [***] proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
If you intend to host piwigo on a subpath (ex: my_domain.tld/gallery) add proxy_set_header X-Forwarded-Prefix /my_subpath at the end of the location section;
listen 80; server_name my_domain.tld; location /gallery/ { proxy_pass [***] proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Prefix /gallery; }
Fill out the database form using the following values :
Database configuration: Host: piwigo-db:3306 User: piwigodb_user Password: #Password in .env Database name: piwigodb
Create an admin account and your piwigo is installed !
Go to the folder where your compose.yaml is, stop the container using docker compose down and use rsync to backup ./piwigo-data/
sh# --delete-before will remove your older backup ! rsync -r --delete-before ./piwigo-data/ ./piwigo-data.bck/
Making a backup is always advised before updating
Go to the folder where your compose.yaml is and stop the container. Then pull the new version of the container with docker compose pull and restart it with docker compose up -d
Updating piwigo via the web interface does not replace container updates !
If you prefer using a mysql container instead of mariadb edit compose.yaml and replace mariadb by mysql (be aware it is case sensitive).
If you want to use an existing MySQL/MariaDB database you already setup, use compose-nodb.yaml and rename it compose.yaml.
You can either create .env with piwigo_port= or manually edit the compose file to change the exposed port.
Create a script at ./piwigo-data/scripts/user.sh to run commands before nginx and php start.
eg: to install extra dependencies like pandoc apk add --no-cache pandoc, available packages are listed at alpine pkg index.
Note that the script is run as root.
Two containers :
PHP modules are installed with alpine natives packages, php-fpm is running with the same user as nginx.
Container network trafic is internal in the piwigo-network bridge.
All persistent data is stored in ./piwigo-data/ :
piwigo piwigo files, when a new version is released, new files will be copied overmysql database files from the mariaDB/mysqlscripts allow user to sideload dependencies and other files outside of piwigo
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务