Skip to content

Instantly share code, notes, and snippets.

@gBusato
Created April 26, 2022 06:42
Show Gist options
  • Save gBusato/eb9d0ce760f04afbc07e09b402df0041 to your computer and use it in GitHub Desktop.
Save gBusato/eb9d0ce760f04afbc07e09b402df0041 to your computer and use it in GitHub Desktop.
docker-compose file containing a running instance of Redis / Postgres / PG_Admin
# Run the file with the command: docker-compose -p databases up -d
# Connect other instances using the following network informations
# networks:
# databases_db_network: # databases come from the projet name from command -p PROJECT_NAME run just before
# external: true
version: "3.4"
services:
redis:
container_name: db_redis
image: "redis:alpine"
restart: unless-stopped
ports:
- "6379:6379"
environment:
- REDIS_REPLICATION_MODE=master
networks:
- db_network
pgadmin:
container_name: db_admin_pg
image: dpage/pgadmin4
restart: unless-stopped
ports:
- "5050:80"
volumes:
- db_pgadmin:/root/.pgadmin
networks:
- db_network
environment:
- PGADMIN_DEFAULT_EMAIL=admin@admin.com
- PGADMIN_DEFAULT_PASSWORD=admin123
depends_on:
- db_postgres
postgres:
container_name: db_postgres
image: postgres:12-alpine
networks:
- db_network
ports:
- "5432:5432"
volumes:
- db_pgdata:/data/postgres
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=PASSWORD
- POSTGRES_USER=ROOT
- POSTGRES_DB=DB_DEFAULT
- PG_DATA=/data/postgres
- TZ=Europe/Paris
networks:
db_network:
driver: bridge
volumes:
db_pgdata:
db_pgadmin:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment