adowu commited on
Commit
d3aa440
·
verified ·
1 Parent(s): dd8de7f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -3
Dockerfile CHANGED
@@ -19,11 +19,28 @@ RUN mkdir -p /data && \
19
  chmod 777 /data
20
 
21
  # Eksponowanie portów
 
 
 
 
 
22
  EXPOSE 7860 25 587 143 993
23
 
24
- # Healthcheck
25
  HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
26
  CMD wget --no-verbose --tries=1 --spider http://localhost:7860/ || exit 1
27
 
28
- # Użycie natywnego init system Poste.io (s6-overlay)
29
- CMD ["/init"]
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  chmod 777 /data
20
 
21
  # Eksponowanie portów
22
+ # 7860 - HTTP webmail + admin panel (główny dla HF Spaces)
23
+ # 25 - SMTP (odbieranie poczty)
24
+ # 587 - SMTP Submission (wysyłanie poczty)
25
+ # 143 - IMAP (dostęp do skrzynek)
26
+ # 993 - IMAPS (bezpieczny IMAP)
27
  EXPOSE 7860 25 587 143 993
28
 
29
+ # Healthcheck - sprawdzenie czy serwer działa
30
  HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
31
  CMD wget --no-verbose --tries=1 --spider http://localhost:7860/ || exit 1
32
 
33
+ # Skrypt cleanup - usuwanie starych lock files przed startem
34
+ RUN echo '#!/bin/bash\n\
35
+ set -e\n\
36
+ echo "[Cleanup] Removing stale lock files and PIDs..."\n\
37
+ rm -rf /data/log/s6/*/lock 2>/dev/null || true\n\
38
+ rm -rf /run/*.pid 2>/dev/null || true\n\
39
+ rm -rf /var/run/*.pid 2>/dev/null || true\n\
40
+ rm -rf /run/login/* 2>/dev/null || true\n\
41
+ echo "[Cleanup] Done. Starting Poste.io..."\n\
42
+ exec /init' > /startup-wrapper.sh && \
43
+ chmod +x /startup-wrapper.sh
44
+
45
+ # Użycie wrapper script zamiast bezpośrednio /init
46
+ CMD ["/startup-wrapper.sh"]