Skip to content

Commit

Permalink
Merge pull request #1860 from Agenta-AI/feature/update-oss-production…
Browse files Browse the repository at this point in the history
…-image-pipeline

[Feature]: Added postgres to gh compose for production use
  • Loading branch information
mmabrouk authored Jul 9, 2024
2 parents 8244f7e + b5ea01b commit 804895e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
51 changes: 50 additions & 1 deletion docker-compose.gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ services:
image: ghcr.io/agenta-ai/agenta-backend
environment:
- MONGODB_URI=mongodb://username:password@mongo:27017
- POSTGRES_URI=postgresql+asyncpg://username:password@postgres:5432/agenta_oss
- REDIS_URL=redis://redis:6379/0
- ENVIRONMENT=production
- DATABASE_MODE=v2
- MIGRATION_SRC_MONGO_DB_NAME=v2
- FEATURE_FLAG=oss
- AGENTA_TEMPLATE_REPO=agentaai/templates_v2
- POSTHOG_API_KEY=phc_hmVSxIjTW1REBHXgj2aw4HW9X6CXb6FzerBgP9XenC7
Expand Down Expand Up @@ -60,6 +62,8 @@ services:
depends_on:
mongo:
condition: service_healthy
postgres:
condition: service_healthy
restart: always

agenta-web:
Expand Down Expand Up @@ -140,27 +144,72 @@ services:
command: >
celery -A agenta_backend.main.celery_app worker --concurrency=1 --loglevel=INFO
environment:
- POSTGRES_URI=postgresql+asyncpg://username:password@postgres:5432/agenta_oss
- MONGODB_URI=mongodb://username:password@mongo:27017
- REDIS_URL=redis://redis:6379/0
- CELERY_BROKER_URL=amqp://guest@rabbitmq//
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- FEATURE_FLAG=oss
volumes:
- ./agenta-backend/agenta_backend:/app/agenta_backend
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- mongo
- postgres
- rabbitmq
- redis
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- agenta-network

postgres:
image: postgres:16.2
container_name: postgres
restart: always
environment:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: agenta_oss
ports:
- "5432:5432"
networks:
- agenta-network
volumes:
- postgresdb-data:/var/lib/postgresql/data/
- ./docker-assets/postgres/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

pgadmin:
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: "[email protected]"
PGADMIN_DEFAULT_PASSWORD: "password"
PGADMIN_SERVER_HOST: "postgres"
PGADMIN_SERVER_PORT: 5432
PGADMIN_SERVER_USER: "username"
PGADMIN_SERVER_PASSWORD: "password"
PGADMIN_SERVER_DB: agenta_oss
ports:
- "5050:80"
networks:
- agenta-network
volumes:
- pgadmin-data:/var/lib/pgadmin
depends_on:
postgres:
condition: service_healthy

networks:
agenta-network:
name: agenta-network

volumes:
mongodb_data:
redis_data:
postgresdb-data:
pgadmin-data:
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- REDIS_URL=redis://redis:6379/0
- ENVIRONMENT=development
- DATABASE_MODE=v2
- MIGRATION_SRC_MONGO_DB_NAME=v2
- BARE_DOMAIN_NAME=localhost
- DOMAIN_NAME=http://localhost
- FEATURE_FLAG=oss
Expand Down

0 comments on commit 804895e

Please sign in to comment.