# 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: # - "127.0.0.1:8080:8080" volumes: - ./keys:/keys environment: - 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 - ENABLE_LOG4J=${ENABLE_LOG4J:-false} depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy healthcheck: test: curl 0.0.0.0:${IDENTITY_SERVER_PORT:-8080}/identity/health_check 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: # - "127.0.0.1:8087:8087" environment: - 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 depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy crapi-identity: condition: service_healthy healthcheck: test: curl 0.0.0.0:${COMMUNITY_SERVER_PORT:-8087}/community/home interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M crapi-workshop: container_name: crapi-workshop image: crapi/crapi-workshop:${VERSION:-latest} #ports: # - "127.0.0.1:8000:8000" environment: - 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 depends_on: postgresdb: condition: service_healthy mongodb: condition: service_healthy crapi-identity: condition: service_healthy crapi-community: condition: service_healthy healthcheck: test: curl 0.0.0.0:${WORKSHOP_SERVER_PORT:-8000}/workshop/health_check/ interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M crapi-web: container_name: crapi-web image: crapi/crapi-web:${VERSION:-latest} ports: - "127.0.0.1:8888:80" 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} 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/web/health interval: 15s timeout: 15s retries: 15 deploy: resources: limits: cpus: '0.3' memory: 128M postgresdb: container_name: postgresdb image: 'postgres:14' environment: POSTGRES_USER: admin POSTGRES_PASSWORD: crapisecretpassword POSTGRES_DB: crapi #ports: # - "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.3' memory: 128M mongodb: container_name: mongodb image: 'mongo:4.4' environment: MONGO_INITDB_ROOT_USERNAME: admin MONGO_INITDB_ROOT_PASSWORD: crapisecretpassword #ports: # - "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 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 - "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 volumes: mongodb-data: postgresql-data: