usememos / dotcom

https://www.usememos.com website
https://www.usememos.com
29 stars 51 forks source link

`connect: connection refused` documentation #91

Closed azzamsa closed 4 months ago

azzamsa commented 5 months ago

Hi, 👋🏽

During the migration from sqlite to postgres. I always get connect: connection refused error. I solve this issue using depends_on: keyword in my compose.yml file.

Where should I explain about this in the docs?

version: '3'

services:

  memos:
    image: neosmemo/memos:stable
    restart: always
+    depends_on:
+      - db
    ports:
      - "8084:5230"
    environment:
      - MEMOS_DRIVER=postgres
      - MEMOS_DSN=user=${DB_USERNAME} password=${DB_PASSWORD} dbname=${DB_NAME} host=db sslmode=disable

  db:
    # https://endoflife.date/postgresql
    image: postgres:16.1
    restart: unless-stopped
    volumes: # Don't remove permanent storage for index database files!
      - "./database:/var/lib/postgresql/data/"
    environment:
      POSTGRES_USER: $DB_USERNAME
      POSTGRES_PASSWORD: $DB_PASSWORD
      POSTGRES_DB: $DB_NAME