the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
1.01k stars 121 forks source link

DockerHub #44

Closed FireFtw closed 10 months ago

FireFtw commented 3 years ago

Any interest/plans to maintain a docker image on DockerHub?

Leopere commented 1 year ago

I'm guessing that the fpm-exporter based on the comments is just for prometheus which I'm not using and I copied the rest from your examples.

leojonathanoh commented 1 year ago

I'm guessing that the fpm-exporter based on the comments is just for prometheus which I'm not using and I copied the rest from your examples.

yes, it's not required.

Change to a local docker volume instead of a bind mount:

services:
  snappymail:
    volumes:
      - snappymail:/var/lib/snappymail

volumes:
  snappymail:
    driver: local

Tell me how it goes.

leojonathanoh commented 1 year ago

ugh, i think i found the problem, something with 2.27.x. let me check it out.

leojonathanoh commented 1 year ago

The problem is with some change in 2.27.3. It cannot create the config file on first time by doing php index.php.

For now, use an older image based on 2.27.2, e.g.:

services:
  snappymail:
    image: leojonathanoh/snappymail:pr-1-bd05527
Leopere commented 1 year ago

I'm guessing that the fpm-exporter based on the comments is just for prometheus which I'm not using and I copied the rest from your examples.

yes, it's not required.

Change to a local docker volume instead of a bind mount:

services:
  snappymail:
    volumes:
      - snappymail:/var/lib/snappymail

volumes:
  snappymail:
    driver: local

Tell me how it goes.

same result both ways sadly I even forced Swarm to provision this to a specific node.

 [INFO] Secure cookies activated
 [INFO] Setting permissions on /var/lib/snappymail
 [INFO] Creating default Snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini

with this yaml

version: '3.9'
services:
  snappymail:
    image: leojonathanoh/snappymail:pr-1-bd05527
    environment:
     - DEBUG=true
    volumes:
      # - /root/tank/persist/nixc.us/snappy/production/data:/var/lib/snappymail
      -  snappymail:/var/lib/snappymail

    networks:
      - default
      - traefik
    deploy:
      replicas: 1
      placement:
        constraints:
          # - node.labels.role == db
          - node.hostname == macmini1
          # - node.labels.mac-rack == true
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.snappy.tls=true"
        - "traefik.http.services.snappy.loadbalancer.server.port=8888"
        - "traefik.http.routers.snappy.rule=Host(`snappy.nixc.us`)"
        - "traefik.http.routers.snappy.entrypoints=websecure"
        - "traefik.http.routers.snappy.tls.certresolver=letsencryptresolver"
        - "traefik.http.routers.snappy.service=snappy"
        - "traefik.docker.network=traefik"

networks:
  default:
  traefik:
    external: true 

volumes:
  snappymail:
    driver: local
Leopere commented 1 year ago

image just trying with the simple compose as well now with no success


version: '2'
services:
  snappymail:
    image: leojonathanoh/snappymail:pr-1
    ports:
      - 8888:8888
    environment:
      - DEBUG=true
    volumes:
      - snappymail:/var/lib/snappymail
    networks:
      - default
    restart: unless-stopped

  # This provides prometheus metrics for snappymail's php-fpm
  php-fpm-exporter:
    image: hipages/php-fpm_exporter:2.2.0
    ports:
      - 9253:9253
    environment:
      - PHP_FPM_SCRAPE_URI=tcp://snappymail:9000/status
    networks:
      - default

networks:
  default:

volumes:
  snappymail:
    driver: local
leojonathanoh commented 1 year ago

sorry, i used the wrong tag. Should be the one 21 days ago:

services:
  snappymail:
    image: leojonathanoh/snappymail:pr-1-46dc7df 
Leopere commented 1 year ago

That tag works and this is the console feedback from it.

 [INFO] Secure cookies activated
 [INFO] Setting permissions on /var/lib/snappymail
 [INFO] Creating default Snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini
 [INFO] Checking whether Snappymail is alive
 2023-04-13 18:37:25,780 INFO spawned: 'subprocess-stopped_00' with pid 34
 2023-04-13 18:37:25,782 INFO spawned: 'nginx_00' with pid 35
 2023-04-13 18:37:25,785 INFO spawned: 'php-fpm_00' with pid 36
 2023-04-13 18:37:25,808 INFO success: nginx_00 entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
 2023-04-13 18:37:25,808 INFO success: php-fpm_00 entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
 [13-Apr-2023 18:37:25] NOTICE: fpm is running, pid 36
 [13-Apr-2023 18:37:25] NOTICE: ready to handle connections
 [INFO] Creating Snappymail admin password file: /var/lib/snappymail/_data_/_default_/admin_password.txt
 [INFO] Snappymail Admin Panel ready at http://localhost:8888/?admin. Login using password in /var/lib/snappymail/_data_/_default_/admin_password.txt
 2023-04-13 18:37:26,819 INFO success: subprocess-stopped_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
 2023-04-13 18:37:26,819 INFO reaped unknown pid 29 (exit status 0)
leojonathanoh commented 1 year ago

yes, that means it works.

Leopere commented 1 year ago

yes it seems to load ok now.

leojonathanoh commented 1 year ago

traced it down to dd74759adc61af9672f7da6e06d96c9ea50d501c,

i'll file a bug report.

Leopere commented 1 year ago

glad my complaint helped!! hope theres a new image inbound soon.

leojonathanoh commented 1 year ago

sorry for the confusion, wasted a bit of your time. Need a few improvements, like outputting the php exception, better error handling.

Leopere commented 1 year ago

no you ostensibly saved me from having to try and write this so I think any time invested is not a waste

leojonathanoh commented 1 year ago

unfortunately we got to wait out for a fix for the bug in 2.27.3, but i've pushed a later image that prints out the exception clearly.

Leopere commented 1 year ago

all good. its in progress now so I have faith that things will get better soon.

jpduyx commented 1 year ago

any news on this?

Leopere commented 1 year ago

I would also love news on this officially. Adding SnappyMail to the world will be a massive win for Privacy for the world at large. It makes GPG available and within reach for people, which will be a colossal win overall.

the-djmaze commented 10 months ago

https://hub.docker.com/r/djmaze/snappymail

xgbstar1 commented 10 months ago

Link for public viewing https://hub.docker.com/r/djmaze/snappymail

Leopere commented 10 months ago

BLESS THIS HUMAN