Skip to content

Commit

Permalink
Setup(Docker): Add docker-compose.yaml file for running the applicati…
Browse files Browse the repository at this point in the history
…on and .env.example
  • Loading branch information
ktutak1337 committed Jun 26, 2024
1 parent f4fb767 commit a42f2fa
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 10 deletions.
40 changes: 40 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# URL for the StellarChat backend API
# e.g., http://localhost:7123 or http://app.example.com
API_URL=<your_backend_url>

# Name of the MongoDB database to use
MONGO_DATABASE=StellarChat # Keep this value or change as desired

# Username for MongoDB root user
MONGO_INITDB_ROOT_USERNAME=<your_mongodb_username>

# Password for MongoDB root user
MONGO_INITDB_ROOT_PASSWORD=<your_mongodb_password>

# Endpoint URL for Qdrant vector search engine.
# It is not recommended to change the alias 'stellar-chat-qdrant' as it is used for internal API communication.
# Only adjust the port number if needed.
QDRANT_ENDPOINT=http://stellar-chat-qdrant:6334

# URL for Seq logging server
# It is not recommended to change the alias 'stellar-chat-seq' as it is used for internal API communication.
# Only adjust the port number if needed.
SEQ_URL=http://stellar-chat-seq:5342

# API key for authenticating with Seq
SEQ_API_KEY=<your_seq_api_key>

# Admin password for Seq
SEQ_ADMIN_PASSWORD=<your_seq_admin_password>

# Allowed origins for CORS, typically the frontend URL. This is an array, separate elements with commas.
# Use '*' as a wildcard to allow all origins, but this is not recommended for production.
CORS_ALLOWED_ORIGINS=*


# === Model Keys ===
# Keys for accessing services with LLM models
# ==================

# OpenAI API key for accessing OpenAI services
OPENAI_API_KEY=<your_openai_api_key>
89 changes: 89 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
services:
webapp:
image: ktutak/stellarchat-web:latest
container_name: stellarchat-web
hostname: stellar-chat-web
restart: unless-stopped
environment:
- API__URL=${API_URL}
ports:
- 7080:7080
networks:
- stellarchat-network
depends_on:
- webapi

webapi:
image: ktutak/stellarchat-api:latest
container_name: stellarchat-api
hostname: stellar-chat-api
restart: unless-stopped
environment:
- OPENAI__API_KEY=${OPENAI_API_KEY}
- MONGO__CONNECTION_STRING=mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@stellar-chat-mongo:27017
- MONGO__DATABASE=${MONGO_DATABASE}
- QDRANT__ENDPOINT=${QDRANT_ENDPOINT}
- SEQ__URL=${SEQ_URL}
- SEQ__API_KEY=${SEQ_API_KEY}
- CORS__ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS}
ports:
- 8080:8080
networks:
- stellarchat-network
volumes:
- webapi_data:/app/_data
depends_on:
- mongodb
- qdrant

mongodb:
image: mongo
container_name: stellarchat-mongo
hostname: stellar-chat-mongo
restart: unless-stopped
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
ports:
- 27018:27017
networks:
- stellarchat-network
volumes:
- mongo_data:/data/db

seq:
image: datalust/seq
container_name: stellarchat-seq
hostname: stellar-chat-seq
restart: unless-stopped
environment:
- ACCEPT_EULA=Y
# - SEQ_FIRSTRUN_ADMINPASSWORDHASH=${SEQ_ADMIN_PASSWORD}
networks:
- stellarchat-network
ports:
- 5342:80
volumes:
- seq_data:/data

qdrant:
image: qdrant/qdrant:latest
container_name: stellarchat-qdrant
hostname: stellar-chat-qdrant
restart: unless-stopped
networks:
- stellarchat-network
ports:
- 6334:6333
volumes:
- qdrant_data:/data

networks:
stellarchat-network:
driver: bridge

volumes:
webapi_data:
seq_data:
mongo_data:
qdrant_data:
9 changes: 0 additions & 9 deletions docker/webapi/.env.example

This file was deleted.

1 change: 0 additions & 1 deletion docker/webapp/.env.example

This file was deleted.

0 comments on commit a42f2fa

Please sign in to comment.