Skip to content

Commit

Permalink
add to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Jan 7, 2025
1 parent b4a8cd2 commit a365e7e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .env-example → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ CERBERUS_HOME=${HOME}/cerberus
CERBERUS_KEYSTORE_DIR=${CERBERUS_HOME}/data/keystore
CERBERUS_GRPC_PORT=50051
CERBERUS_METRICS_PORT=9081

DB_NAME=cerberus
DB_USER=postgres
DB_PASSWORD=postgres
DB_PORT=5432
22 changes: 21 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
cerberus:
image: ghcr.io/layr-labs/cerberus:latest
Expand All @@ -9,8 +8,29 @@ services:
environment:
- "KEYSTORE_DIR=/keystore"
- "METRICS_PORT=${CERBERUS_METRICS_PORT}"
- "POSTGRES_DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:5432/${DB_NAME}?sslmode=disable"
volumes:
- "${CERBERUS_KEYSTORE_DIR}:/keystore"
env_file:
- .env
restart: unless-stopped
depends_on:
- db

db:
image: postgres:15
container_name: db
ports:
- "${DB_PORT}:${DB_PORT}"
environment:
- "POSTGRES_PASSWORD=${DB_PASSWORD}"
- "POSTGRES_USER=${DB_USER}"
- "POSTGRES_DB=${DB_NAME}"
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
- .env
restart: unless-stopped

volumes:
postgres_data:
2 changes: 1 addition & 1 deletion internal/database/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_PASSWORD=password
DB_USER=user
DB_NAME=db
DB_NAME=cerberus
DB_PORT=5432

0 comments on commit a365e7e

Please sign in to comment.