[GH-ISSUE #1267] Using sqlite for the docker container not working #615

Closed
opened 2026-02-25 21:35:30 +03:00 by kerem · 1 comment
Owner

Originally created by @jkaberg on GitHub (Oct 3, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1267

💬 Question

I'm trying to run the docker container using sqlite as an database backend, while setting this up I noticed this comment aswell as the comments in database.php and configured the container accordingly like so

  cypht:
    image: cypht/cypht:2.4.0
    restart: unless-stopped
    depends_on:
      - stalwart
    volumes:
      - ${STORAGE_DIR}/mail/cypht/data:/var/lib/hm3
    environment:
      - AUTH_USERNAME=<secret>
      - AUTH_PASSWORD=<secret>
      - DB_CONNECTION_TYPE=socket
      - DB_DRIVER=sqlite
      - DB_SOCKET=/var/lib/hm3/db.sqlite
      - SESSION_TYPE=DB
      - USER_CONFIG_TYPE=DB
      - SMTP_SERVER=stalwart
      - SMTP_PORT=587
      - IMAP_SERVER=stalwart
      - IMAP_PORT=993
    networks:
      - traefik

However upon inspecting the logs the container is failing to start and I'm seeing:

cypht-1  |
cypht-1  | Attempting to connect to database ... (1/10)
cypht-1  | Attempting to connect to database ... (2/10)
cypht-1  | Attempting to connect to database ... (3/10)
cypht-1  | Attempting to connect to database ... (4/10)
cypht-1  | Attempting to connect to database ... (5/10)
cypht-1  | Attempting to connect to database ... (6/10)
cypht-1  | Attempting to connect to database ... (7/10)
cypht-1  | Attempting to connect to database ... (8/10)
cypht-1  | Attempting to connect to database ... (9/10)
cypht-1  | Attempting to connect to database ... (10/10)
cypht-1  | Unable to connect to database
cypht-1 exited with code 0
cypht-1  |
cypht-1  | Attempting to connect to database ... (1/10)
cypht-1  | Attempting to connect to database ... (2/10)
cypht-1  | Attempting to connect to database ... (3/10)
cypht-1  | Attempting to connect to database ... (4/10)
cypht-1  | Attempting to connect to database ... (5/10)
cypht-1  | Attempting to connect to database ... (6/10)
cypht-1  | Attempting to connect to database ... (7/10)
cypht-1  | Attempting to connect to database ... (8/10)
cypht-1  | Attempting to connect to database ... (9/10)
cypht-1  | Attempting to connect to database ... (10/10)
cypht-1  | Unable to connect to database
cypht-1  |
cypht-1  | Attempting to connect to database ... (1/10)
cypht-1  | Attempting to connect to database ... (2/10)
cypht-1  | Attempting to connect to database ... (3/10)
cypht-1  | Attempting to connect to database ... (4/10)
cypht-1  | Attempting to connect to database ... (5/10)
cypht-1  | Attempting to connect to database ... (6/10)
cypht-1  | Attempting to connect to database ... (7/10)
cypht-1  | Attempting to connect to database ... (8/10)

Am I missing something?

Originally created by @jkaberg on GitHub (Oct 3, 2024). Original GitHub issue: https://github.com/cypht-org/cypht/issues/1267 ## 💬 Question <!-- Describe your Question in detail. Include screenshots and drawings if needed. --> I'm trying to run the docker container using sqlite as an database backend, while setting this up I noticed this [comment](https://github.com/cypht-org/cypht/issues/353#issuecomment-507773747) aswell as the comments in [database.php](https://github.com/cypht-org/cypht/blob/master/config/database.php) and configured the container accordingly like so ``` cypht: image: cypht/cypht:2.4.0 restart: unless-stopped depends_on: - stalwart volumes: - ${STORAGE_DIR}/mail/cypht/data:/var/lib/hm3 environment: - AUTH_USERNAME=<secret> - AUTH_PASSWORD=<secret> - DB_CONNECTION_TYPE=socket - DB_DRIVER=sqlite - DB_SOCKET=/var/lib/hm3/db.sqlite - SESSION_TYPE=DB - USER_CONFIG_TYPE=DB - SMTP_SERVER=stalwart - SMTP_PORT=587 - IMAP_SERVER=stalwart - IMAP_PORT=993 networks: - traefik ``` However upon inspecting the logs the container is failing to start and I'm seeing: ``` cypht-1 | cypht-1 | Attempting to connect to database ... (1/10) cypht-1 | Attempting to connect to database ... (2/10) cypht-1 | Attempting to connect to database ... (3/10) cypht-1 | Attempting to connect to database ... (4/10) cypht-1 | Attempting to connect to database ... (5/10) cypht-1 | Attempting to connect to database ... (6/10) cypht-1 | Attempting to connect to database ... (7/10) cypht-1 | Attempting to connect to database ... (8/10) cypht-1 | Attempting to connect to database ... (9/10) cypht-1 | Attempting to connect to database ... (10/10) cypht-1 | Unable to connect to database cypht-1 exited with code 0 cypht-1 | cypht-1 | Attempting to connect to database ... (1/10) cypht-1 | Attempting to connect to database ... (2/10) cypht-1 | Attempting to connect to database ... (3/10) cypht-1 | Attempting to connect to database ... (4/10) cypht-1 | Attempting to connect to database ... (5/10) cypht-1 | Attempting to connect to database ... (6/10) cypht-1 | Attempting to connect to database ... (7/10) cypht-1 | Attempting to connect to database ... (8/10) cypht-1 | Attempting to connect to database ... (9/10) cypht-1 | Attempting to connect to database ... (10/10) cypht-1 | Unable to connect to database cypht-1 | cypht-1 | Attempting to connect to database ... (1/10) cypht-1 | Attempting to connect to database ... (2/10) cypht-1 | Attempting to connect to database ... (3/10) cypht-1 | Attempting to connect to database ... (4/10) cypht-1 | Attempting to connect to database ... (5/10) cypht-1 | Attempting to connect to database ... (6/10) cypht-1 | Attempting to connect to database ... (7/10) cypht-1 | Attempting to connect to database ... (8/10) ``` Am I missing something?
kerem closed this issue 2026-02-25 21:35:30 +03:00
Author
Owner

@jkaberg commented on GitHub (Oct 3, 2024):

Sorry, my fault. Working config for sqlite:

  cypht:
    image: cypht/cypht:2.4.0
    restart: unless-stopped
    volumes:
      - ${STORAGE_DIR}/mail/cypht/data:/var/lib/hm3
    environment:
      - AUTH_USERNAME=<secret>
      - AUTH_PASSWORD=<secret>
      - DB_CONNECTION_TYPE=socket
      - DB_DRIVER=sqlite
      - DB_SOCKET=/var/lib/hm3/db.sqlite
      - SESSION_TYPE=DB
      - USER_CONFIG_TYPE=DB
      - SMTP_SERVER=server
      - SMTP_PORT=587
      - IMAP_SERVER=server
      - IMAP_PORT=993
<!-- gh-comment-id:2390732517 --> @jkaberg commented on GitHub (Oct 3, 2024): Sorry, my fault. Working config for sqlite: ``` cypht: image: cypht/cypht:2.4.0 restart: unless-stopped volumes: - ${STORAGE_DIR}/mail/cypht/data:/var/lib/hm3 environment: - AUTH_USERNAME=<secret> - AUTH_PASSWORD=<secret> - DB_CONNECTION_TYPE=socket - DB_DRIVER=sqlite - DB_SOCKET=/var/lib/hm3/db.sqlite - SESSION_TYPE=DB - USER_CONFIG_TYPE=DB - SMTP_SERVER=server - SMTP_PORT=587 - IMAP_SERVER=server - IMAP_PORT=993 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#615
No description provided.