# Licensed under the Apache License, Version 2.0 (the “License”); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an “AS IS” BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. services: crapi-identity: container_name: crapi-identity image: crapi/crapi-identity:${VERSION:-latest} # ports: # - "${LISTEN_IP:-127.0.0.1}:8080:8080" volumes: - ./keys:/app/keys environment: - LOG_LEVEL=${LOG_LEVEL:-INFO} - DB_NAME=crapi - DB_USER=admin - DB_PASSWORD=crapisecretpassword - DB_HOST=postgresdb - DB_PORT=5432 - SERVER_PORT=${IDENTITY_SERVER_PORT:-8080} - ENABLE_SHELL_INJECTION=${ENABLE_SHELL_INJECTION:-false} - JWT_SECRET=crapi - MAILHOG_HOST=mailhog - MAILHOG_PORT=1025 - MAILHOG_DOMAIN=example.com - SMTP_HOST=smtp.example.com - SMTP_PORT=587 - SMTP_EMAIL=user@example.com - SMTP_PASS=xxxxxxxxxxxxxx - SMTP_FROM=no-reply@example.com - SMTP_AUTH=true - SMTP_STARTTLS=true - JWT_EXPIRATION=604800000 - ENABLE_LOG4J=${ENABLE_LOG4J:-false} - API_GATEWAY_URL=https://api.mypremiumdealership.com - TLS_ENABLED=${TLS_ENABLED:-false} - TLS_KEYSTORE_TYPE=PKCS12 - TLS_KEYSTORE=classpath:certs/server.p12 - TLS_KEYSTORE_PASSWORD=passw0rd - TLS_KEY_PASSWORD=passw0rd - TLS_KEY_ALIAS=identity depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy mailhog: condition: service_healthy healthcheck: test: /app/health.sh interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.8' memory: 384M crapi-community: container_name: crapi-community image: crapi/crapi-community:${VERSION:-latest} #ports: # - "${LISTEN_IP:-127.0.0.1}:8087:8087" environment: - LOG_LEVEL=${LOG_LEVEL:-INFO} - IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080} - DB_NAME=crapi - DB_USER=admin - DB_PASSWORD=crapisecretpassword - DB_HOST=postgresdb - DB_PORT=5432 - SERVER_PORT=${COMMUNITY_SERVER_PORT:-8087} - MONGO_DB_HOST=mongodb - MONGO_DB_PORT=27017 - MONGO_DB_USER=admin - MONGO_DB_PASSWORD=crapisecretpassword - MONGO_DB_NAME=crapi - TLS_ENABLED=${TLS_ENABLED:-false} - TLS_CERTIFICATE=certs/server.crt - TLS_KEY=certs/server.key depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy crapi-identity: condition: service_healthy healthcheck: test: /app/health.sh interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 192M crapi-workshop: container_name: crapi-workshop image: crapi/crapi-workshop:${VERSION:-latest} #ports: # - "${LISTEN_IP:-127.0.0.1}:8000:8000" environment: - LOG_LEVEL=${LOG_LEVEL:-INFO} - IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080} - DB_NAME=crapi - DB_USER=admin - DB_PASSWORD=crapisecretpassword - DB_HOST=postgresdb - DB_PORT=5432 - SERVER_PORT=${WORKSHOP_SERVER_PORT:-8000} - MONGO_DB_HOST=mongodb - MONGO_DB_PORT=27017 - MONGO_DB_USER=admin - MONGO_DB_PASSWORD=crapisecretpassword - MONGO_DB_NAME=crapi - SECRET_KEY=crapi - API_GATEWAY_URL=https://api.mypremiumdealership.com - TLS_ENABLED=${TLS_ENABLED:-false} - TLS_CERTIFICATE=certs/server.crt - TLS_KEY=certs/server.key - FILES_LIMIT=1000 depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy crapi-identity: condition: service_healthy crapi-community: condition: service_healthy healthcheck: test: /app/health.sh interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M crapi-chatbot: container_name: crapi-chatbot image: crapi/crapi-chatbot:${VERSION:-latest} environment: - TLS_ENABLED=${TLS_ENABLED:-false} - SERVER_PORT=${CHATBOT_SERVER_PORT:-5002} - WEB_SERVICE=crapi-web - IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080} - DB_NAME=crapi - DB_USER=admin - DB_PASSWORD=crapisecretpassword - DB_HOST=postgresdb - DB_PORT=5432 - MONGO_DB_HOST=mongodb - MONGO_DB_PORT=27017 - MONGO_DB_USER=admin - MONGO_DB_PASSWORD=crapisecretpassword - MONGO_DB_NAME=crapi - API_USER=admin@example.com - API_PASSWORD=Admin!123 - OPENAPI_SPEC=/app/resources/crapi-openapi-spec.json - CHATBOT_LLM_PROVIDER=${CHATBOT_LLM_PROVIDER:-openai} - CHATBOT_LLM_MODEL=${CHATBOT_LLM_MODEL:-} - CHATBOT_EMBEDDINGS_MODEL=${CHATBOT_EMBEDDINGS_MODEL:-} - CHATBOT_EMBEDDINGS_DIMENSIONS=${CHATBOT_EMBEDDINGS_DIMENSIONS:-1536} - CHATBOT_OPENAI_API_KEY=${CHATBOT_OPENAI_API_KEY:-} - CHATBOT_OPENAI_BASE_URL=${CHATBOT_OPENAI_BASE_URL:-} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} - AZURE_OPENAI_API_KEY=${AZURE_OPENAI_API_KEY:-} - AZURE_AD_TOKEN=${AZURE_AD_TOKEN:-} - AZURE_OPENAI_ENDPOINT=${AZURE_OPENAI_ENDPOINT:-} - AZURE_OPENAI_API_VERSION=${AZURE_OPENAI_API_VERSION:-2024-02-15-preview} - AZURE_OPENAI_CHAT_DEPLOYMENT=${AZURE_OPENAI_CHAT_DEPLOYMENT:-} - AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT=${AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT:-} - GROQ_API_KEY=${GROQ_API_KEY:-} - MISTRAL_API_KEY=${MISTRAL_API_KEY:-} - COHERE_API_KEY=${COHERE_API_KEY:-} - AWS_BEARER_TOKEN_BEDROCK=${AWS_BEARER_TOKEN_BEDROCK:-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} - AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN:-} - AWS_REGION=${AWS_REGION:-} - AWS_ASSUME_ROLE_ARN=${AWS_ASSUME_ROLE_ARN:-} - AWS_EXTERNAL_ID=${AWS_EXTERNAL_ID:-} - AWS_ROLE_SESSION_NAME=${AWS_ROLE_SESSION_NAME:-crapi-chatbot-session} - GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS:-} - VERTEX_PROJECT=${VERTEX_PROJECT:-} - VERTEX_LOCATION=${VERTEX_LOCATION:-} - MAX_CONTENT_LENGTH=50000 - CHROMA_HOST=chromadb - CHROMA_PORT=8000 depends_on: mongodb: condition: service_healthy crapi-identity: condition: service_healthy chromadb: condition: service_healthy # ports: # - "${LISTEN_IP:-127.0.0.1}:5002:5002" crapi-web: container_name: crapi-web image: crapi/crapi-web:${VERSION:-latest} ports: - "${LISTEN_IP:-127.0.0.1}:8888:80" - "${LISTEN_IP:-127.0.0.1}:30080:80" - "${LISTEN_IP:-127.0.0.1}:8443:443" - "${LISTEN_IP:-127.0.0.1}:30443:443" environment: - COMMUNITY_SERVICE=crapi-community:${COMMUNITY_SERVER_PORT:-8087} - IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080} - WORKSHOP_SERVICE=crapi-workshop:${WORKSHOP_SERVER_PORT:-8000} - CHATBOT_SERVICE=crapi-chatbot:${CHATBOT_SERVER_PORT:-5002} - MAILHOG_WEB_SERVICE=mailhog:8025 - TLS_ENABLED=${TLS_ENABLED:-false} depends_on: crapi-community: condition: service_healthy crapi-identity: condition: service_healthy crapi-workshop: condition: service_healthy healthcheck: test: curl 0.0.0.0:80/health interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M postgresdb: container_name: postgresdb image: 'postgres:14' command: ["postgres", "-c", "max_connections=500"] environment: POSTGRES_USER: admin POSTGRES_PASSWORD: crapisecretpassword POSTGRES_DB: crapi #ports: # - "${LISTEN_IP:-127.0.0.1}:5432:5432" healthcheck: test: [ "CMD-SHELL", "pg_isready" ] interval: 15s timeout: 15s retries: 15 volumes: - postgresql-data:/var/lib/postgresql/data/ deploy: resources: limits: cpus: '0.5' memory: 256M mongodb: container_name: mongodb image: 'mongo:4.4' environment: MONGO_INITDB_ROOT_USERNAME: admin MONGO_INITDB_ROOT_PASSWORD: crapisecretpassword #ports: # - "${LISTEN_IP:-127.0.0.1}:27017:27017" healthcheck: test: echo 'db.runCommand("ping").ok' | mongo mongodb:27017/test --quiet interval: 15s timeout: 15s retries: 15 start_period: 20s volumes: - mongodb-data:/data/db deploy: resources: limits: cpus: '0.3' memory: 128M chromadb: container_name: chromadb image: 'chromadb/chroma:latest' environment: IS_PERSISTENT: 'TRUE' healthcheck: test: [ "CMD", "/bin/bash", "-c", "cat < /dev/null > /dev/tcp/localhost/8000" ] interval: 15s timeout: 15s retries: 15 start_period: 20s volumes: - chromadb-data:/data # ports: # - "${LISTEN_IP:-127.0.0.1}:8000:8000" mailhog: user: root container_name: mailhog image: crapi/mailhog:${VERSION:-latest} environment: MH_MONGO_URI: admin:crapisecretpassword@mongodb:27017 MH_STORAGE: mongodb ports: # - "127.0.0.1:1025:1025" # smtp server - "${LISTEN_IP:-127.0.0.1}:8025:8025" # Mail ui healthcheck: test: [ "CMD", "nc", "-z", "localhost", "8025" ] interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M api.mypremiumdealership.com: container_name: api.mypremiumdealership.com image: crapi/gateway-service:${VERSION:-latest} #ports: # - "${LISTEN_IP:-127.0.0.1}:8443:443" # https healthcheck: test: bash -c 'echo -n "GET / HTTP/1.1\n\n" > /dev/tcp/127.0.0.1/443' interval: 15s timeout: 15s retries: 15 start_period: 15s deploy: resources: limits: cpus: '0.1' memory: 50M volumes: mongodb-data: postgresql-data: chromadb-data: