microservices icon indicating copy to clipboard operation
microservices copied to clipboard

Does not create database while doing the docker compose up -d

Open PauloSeravia opened this issue 4 years ago • 3 comments

I had to add the following to the docker-compose.yml

environment: POSTGRES_DB: customer

PauloSeravia avatar Dec 07 '21 22:12 PauloSeravia

I had to add the following to the docker-compose.yml

environment: POSTGRES_DB: customer

Check if you have your desktop docker running

lennsw avatar Dec 28 '21 03:12 lennsw

If you get password authentication failed for user error then change volumes in .yml file volumes: - ./postgres-data:/var/lib/postgresql/data

Djungarik avatar Mar 14 '22 14:03 Djungarik

services:
  postgres:
    container_name: postgres
    image: postgres
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-amigoscode}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
      PGDATA: /data/postgres
    volumes:
      - type: volume
        source: postgres
        target: /data/postgres
    ports:
      - "5431:5432"
    networks:
      - postgres
    restart: unless-stopped
  pgadmin:
    container_name: pgadmin
    image: dpage/pgadmin4
    environment:
      PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
      PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
      PGADMIN_CONFIG_SERVER_MODE: 'False'
    volumes:
      - type: volume
        source: pgadmin
        target: /var/lib/pgadmin
    ports:
      - "${PGADMIN_PORT:-5050}:80"
    networks:
      - postgres
    restart: unless-stopped

networks:
  postgres:
    driver: bridge

volumes:
  postgres:
  pgadmin:

cami-la avatar May 25 '22 23:05 cami-la