Git Product home page Git Product logo

Comments (3)

sparkvilla avatar sparkvilla commented on August 12, 2024 1

Ok. I find it!!

In the .envfile I had this line:

DB_HOST=localhost

But actually the comment says: # If using docker, DB_HOST is the database container name

So, I rename it to
DB_HOST=mmgis-db-1

And now I can connect to the db. Thank you for the support!

from mmgis.

tariqksoliman avatar tariqksoliman commented on August 12, 2024

Hi and interesting. Any chance you already have postgresql on your machine and are pointing to the same data directory? Maybe try changing the DB_NAME in your .env to point to another database other than db. I would also try entering the mmgis docker container and check the connection to postgres from there with the values you have in the .env. Something like:

docker ps
docker exec -it {mycontainer} bash
apt install postgresql-client
psql -h {host} -U {username} -p

from mmgis.

sparkvilla avatar sparkvilla commented on August 12, 2024

@tariqksoliman Thank you for your help.

I checked whether postgresql db is already running on my host, and that seems not to be the case.

❯ sudo systemctl status postgresql
Unit postgresql.service could not be found.

I changed DB_NAMEand that did not have any effect. Yet, I tried to enter the mmgis container from another terminal window (after running docker compose up ) and I get:

❯ docker exec -it 80f835b29091 bash
Error response from daemon: Container 80f835b290910343ec73b16b37af4d182983b2b7a7448ee5bf8a5647dbd69494 is restarting, wait until the container is running

This is because the mmgis container keeps restarting.

I share my docker-compose.yml

version: "3"
services:
  mmgis:
    build: .
    depends_on:
      - db
    env_file: .env
    ports:
      - 8888:8888
    restart: on-failure
    volumes:
      - ./Missions:/usr/src/app/Missions
  db:
    image: postgis/postgis:10-2.5-alpine
    env_file: .env
    ports:
      - 5432:5432
    restart: on-failure
    volumes:
      - mmgis-db:/var/lib/postgresql/data
volumes:
  mmgis-db:

and the relevant part of my .env file

# Postgres' default port is 5432
DB_PORT=5432
DB_NAME=db
DB_USER=postgres
DB_PASS=test

not sure what else to try for the moment..

from mmgis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.