Skip to content

Instantly share code, notes, and snippets.

@fritolays
Last active April 19, 2024 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fritolays/db35de246eff9611028e8b5935bd643f to your computer and use it in GitHub Desktop.
Save fritolays/db35de246eff9611028e8b5935bd643f to your computer and use it in GitHub Desktop.
Modification of the piler (mailpiler) docker-compose for use with Unraid and Compose Manager Plugin

Original docker-compose.yml:
https://github.com/jsuto/piler/blob/master/docker/docker-compose.yaml

Essentially, I just moved the things that need setting to the .env file, and mapped the named volumes to appdata.
This is the open source edition, but the compose file for the enterprise edition is setup in a similar way.

Requirements:
Docker Compose Manager plugin:
https://forums.unraid.net/topic/114415-plugin-docker-compose-manager/

Setup:

  1. Once Compose Manager is installed goto the bottom of the Docker page and click Add New Stack.
  2. Give your stack an appropriate name, ie: mailpiler.
  3. Now Edit your new stack.
  4. Select the compose file.
  5. Copy over the contents of 1-docker-compose.yml and save changes.
  6. Stack labels...
    For mysql - Icon: /mnt/user/appdata/mailpiler/mariadb.png
    For piler:
    Icon: /mnt/user/appdata/mailpiler/piler.png
    Web UI: http://[IP]:[PORT:pick_a_port]
    Click ok.
  7. Now Edit the stack again.
  8. Select the env file.
  9. Copy over the contents of 2-env.
  10. Edit the details for your setup and save changes,
  11. Now you MUST manually create the folders in appdata, main mailpiler folder plus 4 subfolders, you defined in the .env file.
  12. You can also find and add icons to the mailpiler main folder to use in the Unraid gui.
  13. Once folders are created, and optionally icons found and saved, click Compose Up.
  14. It should download, start, and say connection closed eventually.
  15. Should be able to login to the webui.
    Username: admin@local
    Password: pilerrocks
  16. From here is your own adventure.
services:
mysql:
image: mariadb:11.1.2
container_name: mysql
restart: unless-stopped
cap_drop:
- ALL
cap_add:
- dac_override
- setuid
- setgid
environment:
- MYSQL_DATABASE=piler
- MYSQL_USER=piler
- MYSQL_PASSWORD=${SQL_PASS}
- MYSQL_RANDOM_ROOT_PASSWORD=yes
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- db_data:/var/lib/mysql
piler:
image: sutoj/piler:${VERSION:-1.4.5}
container_name: piler
init: true
environment:
- MYSQL_HOSTNAME=mysql
- MYSQL_DATABASE=piler
- MYSQL_USER=piler
- MYSQL_PASSWORD=${SQL_PASS}
- PILER_HOSTNAME=${ARCHIVE_HOST}:${ARCHIVE_PORT}
- RT=1
ports:
- "${SMTP_PORT}:25"
- "${ARCHIVE_PORT}:80"
volumes:
- piler_etc:/etc/piler
- piler_manticore:/var/piler/manticore
- piler_store:/var/piler/store
healthcheck:
test: curl -s smtp://localhost/
interval: "20s"
timeout: "3s"
start_period: "15s"
retries: 3
deploy:
resources:
reservations:
memory: 512M
limits:
memory: 512M
depends_on:
- "mysql"
volumes:
db_data:
driver: local
driver_opts:
type: none
o: bind
device: ${DB_DATA}
piler_etc:
driver: local
driver_opts:
type: none
o: bind
device: ${PILER_ETC}
piler_manticore:
driver: local
driver_opts:
type: none
o: bind
device: ${PILER_MANTICORE}
piler_store:
driver: local
driver_opts:
type: none
o: bind
device: ${PILER_STORE}
# local ip does work here for setup, but you will likely need a real https domain for it to work properly
ARCHIVE_HOST=192.168.4.5
# webui port
ARCHIVE_PORT=pick_a_port
# smtp port
SMTP_PORT=25
# mysql(mariadb) password
SQL_PASS=you_should_set_a_better_password
# local mapped folders
DB_DATA=/mnt/user/appdata/mailpiler/db_data
PILER_ETC=/mnt/user/appdata/mailpiler/piler_etc
PILER_MANTICORE=/mnt/user/appdata/mailpiler/piler_manticore
PILER_STORE=/mnt/user/appdata/mailpiler/piler_store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment