microservices
microservices copied to clipboard
Does not create database while doing the docker compose up -d
I had to add the following to the docker-compose.yml
environment: POSTGRES_DB: customer
I had to add the following to the docker-compose.yml
environment: POSTGRES_DB: customer
Check if you have your desktop docker running
If you get password authentication failed for user error then change volumes in .yml file volumes: - ./postgres-data:/var/lib/postgresql/data
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: