Skip to content

Instantly share code, notes, and snippets.

@shinebayar-g
Last active November 3, 2020 07:26
Show Gist options
  • Save shinebayar-g/a891534a8d21673bc48e87b845920fa9 to your computer and use it in GitHub Desktop.
Save shinebayar-g/a891534a8d21673bc48e87b845920fa9 to your computer and use it in GitHub Desktop.
Task
version: "2.1"
services:
erxes-ui:
image: erxes/erxes:develop
restart: unless-stopped
environment:
REACT_APP_CDN_HOST: https://{DOMAIN}/widgets
REACT_APP_API_URL: https://{DOMAIN}/api
REACT_APP_API_SUBSCRIPTION_URL: wss://{DOMAIN}/api/subscriptions
NGINX_HOST: {DOMAIN}
ports:
- "127.0.0.1:3000:80"
networks:
- erxes
erxes-api:
image: erxes/erxes-api:develop
restart: unless-stopped
environment:
PORT: "3300"
NODE_ENV: production
JWT_TOKEN_SECRET: {JWT_TOKEN_SECRET}
DEBUG: "erxes-api:*"
DOMAIN: https://{DOMAIN}/api
MAIN_APP_DOMAIN: https://{DOMAIN}
WIDGETS_DOMAIN: https://{DOMAIN}/widgets
INTEGRATIONS_API_DOMAIN: https://{DOMAIN}/integrations
LOGS_API_DOMAIN: http://erxes-logger:3800
ENGAGES_API_DOMAIN: http://erxes-engages:3900
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes?authSource=admin&replicaSet=rs0
ELASTICSEARCH_URL: http://erxes-elasticsearch:9200
REDIS_HOST: "erxes-redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "{REDIS_PASSWORD}"
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
ports:
- "127.0.0.1:3300:3300"
networks:
- erxes
erxes-crons:
image: erxes/erxes-api:develop
entrypoint: ["node", "--max_old_space_size=8192", "dist/cronJobs"]
restart: unless-stopped
environment:
PORT_CRONS: "3600"
NODE_ENV: production
PROCESS_NAME: crons
DEBUG: "erxes-crons:*"
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes?authSource=admin&replicaSet=rs0
ELASTICSEARCH_URL: http://erxes-elasticsearch:9200
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
REDIS_HOST: "erxes-redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "{REDIS_PASSWORD}"
networks:
- erxes
erxes-workers:
image: erxes/erxes-api:develop
entrypoint: ["node", "--max_old_space_size=8192", "dist/workers"]
restart: unless-stopped
environment:
PORT_WORKERS: "3700"
NODE_ENV: production
DEBUG: "erxes-workers:*"
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes?authSource=admin&replicaSet=rs0
REDIS_HOST: "erxes-redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "{REDIS_PASSWORD}"
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
networks:
- erxes
erxes-widgets:
image: erxes/erxes-widgets:develop
restart: unless-stopped
environment:
PORT: "3200"
ROOT_URL: https://{DOMAIN}/widgets
MAIN_API_URL: https://{DOMAIN}/api
API_SUBSCRIPTIONS_URL: wss://{DOMAIN}/api/subscriptions
ports:
- "127.0.0.1:3200:3200"
networks:
- erxes
erxes-integrations:
image: erxes/erxes-integrations:develop
restart: unless-stopped
environment:
PORT: "3400"
NODE_ENV: production
DEBUG: "erxes-integrations:*"
DOMAIN: https://{DOMAIN}/integrations
MAIN_APP_DOMAIN: https://{DOMAIN}
MAIN_API_DOMAIN: https://{DOMAIN}/api
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes_integrations?authSource=admin&replicaSet=rs0
FACEBOOK_APP_ID: "{FACEBOOK_APP_ID}"
FACEBOOK_APP_SECRET: "{FACEBOOK_APP_SECRET}"
FACEBOOK_VERIFY_TOKEN: "{FACEBOOK_VERIFY_TOKEN}"
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
REDIS_HOST: "erxes-redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "{REDIS_PASSWORD}"
ports:
- "127.0.0.1:3400:3400"
networks:
- erxes
erxes-logger:
image: erxes/erxes-logger:master
restart: unless-stopped
environment:
PORT: "3800"
DEBUG: "erxes-logs:*"
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes_logs?authSource=admin&replicaSet=rs0
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
networks:
- erxes
erxes-engages:
image: erxes/erxes-engages-email-sender:develop
restart: unless-stopped
environment:
PORT: "3900"
NODE_ENV: production
DEBUG: "erxes-engages:*"
MAIN_API_DOMAIN: https://{DOMAIN}/api
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes_engages?authSource=admin&replicaSet=rs0
RABBITMQ_HOST: "amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@erxes-rabbitmq:5672/erxes"
networks:
- erxes
erxes-elksyncer:
image: erxes/erxes-elksyncer:develop
restart: unless-stopped
environment:
ELASTICSEARCH_URL: http://erxes-elasticsearch:9200
MONGO_URL: mongodb://{MONGODB_USERNAME}:{MONGODB_PASSWORD}@erxes-mongo:27017/erxes?authSource=admin&replicaSet=rs0
volumes:
- erxes-elksyncer:/var/log/mongo-connector
networks:
- erxes
erxes-mongo:
image: mongo:4.0.20
restart: unless-stopped
command: --bind_ip 0.0.0.0 --replSet rs0
environment:
MONGO_INITDB_ROOT_USERNAME: {MONGODB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: {MONGODB_PASSWORD}
volumes:
- erxes-mongo:/data/db
networks:
- erxes
# https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docker.html#docker-prod-prerequisites
erxes-elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
restart: unless-stopped
environment:
http.host: "0.0.0.0"
transport.host: "localhost"
network.host: "0.0.0.0"
discovery.type: "single-node"
path.repo: "/usr/share/elasticsearch/data/backup"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- erxes-elasticsearch:/usr/share/elasticsearch/data
networks:
- erxes
# Optional: Uncomment to enable kibana dashboard for elasticsearch database.
# erxes-kibana:
# image: docker.elastic.co/kibana/kibana:7.5.2
# restart: unless-stopped
# environment:
# SERVER_NAME: erxes-kibana
# SERVER_HOST: "0"
# ELASTICSEARCH_HOSTS: [ "http://erxes-elasticsearch:9200" ]
# XPACK_MONITORING_UI_CONTAINER_ELASTICSEARCH_ENABLED: true
# ports:
# - "127.0.0.1:5601:5601"
# networks:
# - erxes
erxes-rabbitmq:
image: rabbitmq:3.8.8-management-alpine
hostname: erxes-rabbitmq
restart: unless-stopped
environment:
RABBITMQ_ERLANG_COOKIE: {RABBITMQ_ERLANG_COOKIE}
RABBITMQ_DEFAULT_USER: {RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: {RABBITMQ_PASSWORD}
RABBITMQ_DEFAULT_VHOST: "erxes"
volumes:
- erxes-rabbitmq:/var/lib/rabbitmq
ports:
- "127.0.0.1:15672:15672"
networks:
- erxes
erxes-redis:
image: redis:5.0.9-alpine
restart: unless-stopped
command: redis-server --appendonly yes --requirepass {REDIS_PASSWORD}
volumes:
- erxes-redis:/data
networks:
- erxes
volumes:
erxes-elksyncer:
driver: local
erxes-mongo:
driver: local
erxes-elasticsearch:
driver: local
erxes-rabbitmq:
driver: local
erxes-redis:
driver: local
networks:
erxes:
driver: bridge
DOMAIN=erxes.domain.com
JWT_TOKEN_SECRET=
MONGODB_USERNAME=
MONGODB_PASSWORD=
REDIS_PASSWORD=
RABBITMQ_USERNAME=
RABBITMQ_PASSWORD=
RABBITMQ_ERLANG_COOKIE=
FACEBOOK_APP_ID=
FACEBOOK_APP_SECRET=
FACEBOOK_VERIFY_TOKEN=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment