Closed sparkvilla closed 4 months ago
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
@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_NAME
and 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..
Ok. I find it!!
In the .env
file 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!
Checked for duplicates
Yes - I've already checked
Describe the bug
I am following the instruction to install the MMGIS platform using docker. I got to the point of
docker compose up
command. I am getting this output:Is there someone that can help me with that? My host OS is Ubuntu 22.04
What did you expect?
I expected to run the containers
Reproducible steps
Environment