-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to any database #94
Comments
Looking at the timestamps, is it possible that your network already contains another container called |
@SISheogorath - First, thanks for the response. I can't drop from the traefik network all together, as homelab fronts that database with a domain, so it's available outside the machine. That said, I did rename the database service name to codiMdDatabase, and modified the database connection string apropriately. Here's the final docker compose: ---
version: '3'
# This networks section required for the pacakge to be visible to Traefik.
# DO NOT Remove
networks:
traefik_network:
external:
name: homelabos_traefik
services:
codiMdDatabase:
networks:
- traefik_network
image: postgres:9.6-alpine
environment:
# MYSQL_PASSWORD=lookup('password', './settings/passwords/package_name_db_password chars=digits')
- POSTGRES_USER=hackmd
- POSTGRES_PASSWORD=hackmdpass
- POSTGRES_DB=hackmd
volumes:
- "/var/homelabos/codimd/postgresql/data:/var/lib/postgresql/data"
restart: unless-stopped
codiMdApp:
# REQUIRED
image: quay.io/codimd/server:latest
restart: unless-stopped
networks:
- traefik_network
environment:
- CMD_DB_URL=postgres://hackmd:hackmdpass@codiMdDatabase:5432/hackmd
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.services.codimd.loadbalancer.server.scheme=http"
- "traefik.http.services.codimd.loadbalancer.server.port=3000"
- "traefik.http.routers.codimd-http.rule=Host(`codimd.pinguinshow.com`)"
- "traefik.http.routers.codimd-http.entrypoints=http"
- "traefik.http.routers.codimd-http.middlewares=customFrameHomelab@file"
- "traefik.http.routers.codimd.rule=Host(`codimd.pinguinshow.com`)"
- "traefik.http.routers.codimd.entrypoints=https"
- "traefik.http.routers.codimd.middlewares=customFrameHomelab@file"
- "traefik.http.routers.codimd.tls=true"
- "traefik.http.routers.codimd.tls.certresolver=dns"
- "traefik.http.routers.codimd.tls.domains[0].main=pinguinshow.com"
- "traefik.http.routers.codimd.tls.domains[0].sans=*.pinguinshow.com"
depends_on:
- codiMdDatabase However, when I bring this up, I still see failures, and codimd doesn't start. Logs:
|
@SISheogorath - Important Update. Renaming the database service, coupled with using Mariadb works. |
Maybe you have to reset the database volumes in order to make everything work as expected, but that sounds like it goes in the right direction :) If you want to do me a personal favor, you also change the name of database and user, as well as the password, after resetting your db storage 😉 |
That did the trick. And yeah, I changed the name of the user and database as well as the password! Thanks for your help. |
Team,
I'm attempting to add CodiMD to HomelabOS, and when I spin up the containers the app is never able to access the database.
I've tried Postgres and Mariadb, both with configs copy/pasted from: https://github.com/codimd/container/blob/master/docker-compose.yml
The following details reflect my latest testing, with Mariadb. The same issue happened with Postgres. Here's the Docker-compose yml
On startup, the database container shows:
And the App reports
I'm scratching my head here, but it feels like there's something wrong at the sequelize level?
The text was updated successfully, but these errors were encountered: