Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy with custom ports #5

Open
juanbits opened this issue Dec 23, 2021 · 3 comments
Open

deploy with custom ports #5

juanbits opened this issue Dec 23, 2021 · 3 comments

Comments

@juanbits
Copy link

Hi,

I am using a centos dedicated server with shared services, and i want to deploy Tiledesk community.

On the readme instructions, you specify how can We deploy on docker, but some of the public ports in my server has already used by other services.

How can I deploy with custom ports? I only need to change the ports of each container and then modify the next vars in the docker-compose.yaml :
CHAT21_URL
WEBHOOK_ENDPOINT

thanks in advance

@juanbits
Copy link
Author

i deployed the container and this is my docker-compose.yml

version: "3.7"

volumes:
   tiledesk-datadb:
services:
  dashboard:
   image: tiledesk/tiledesk-dashboard:2.2.28
   container_name: tiledesk-dashboard 
   environment: 
      - FEATURES_TOKEN=NAT:T-DEV:T
      - SERVER_BASE_URL=/api/
      - CHAT_BASE_URL=/chat/
      - WS_URL
      - WS_URL_RELATIVE=/api/
      - "WIDGET_LOCATION=${EXTERNAL_BASE_URL}/widget/launch.js"
      - WIDGET_TEST_LOCATION=/widget/assets/twp/index.html
      - CHAT21_ENGINE=mqtt
      - UPLOAD_ENGINE=native
      - PUSH_ENGINE=none
      - FIREBASE_APIKEY
      - FIREBASE_AUTHDOMAIN
      - FIREBASE_DATABASEURL
      - FIREBASE_PROJECT_ID
      - FIREBASE_STORAGEBUCKET
      - FIREBASE_MESSAGINGSENDERID
      - FIREBASE_APP_ID
      - FIREBASE_VAPID
      - LOG_LEVEL=info

   ports:
      - "4150:80" #use expose if you want to block external access

  webwidget:
   image: chat21/chat21-web-widget:5.0.18
   container_name: chat21-web-widget  
   ports: 
      - "4120:80" # specify port forewarding
   environment: 
      - CHAT21_ENGINE=mqtt
      - MQTT_APPID=tilechat
      - PUSH_ENGINE=none
      - LOG_LEVEL=info
      - FILE_UPLOAD_ACCEPT=*/*
      - "MQTT_ENDPOINT=${EXTERNAL_MQTT_BASE_URL}/mqws/ws"
      - "MQTT_APIENDPOINT=${EXTERNAL_BASE_URL}/chatapi/api"
      #- MQTT_LOGINSERVICE_ENDPOINT=/api/chat21/native/auth/createCustomToken      
      - FIREBASE_APIKEY
      - FIREBASE_AUTHDOMAIN
      - FIREBASE_DATABASEURL
      - FIREBASE_PROJECT_ID
      - FIREBASE_STORAGEBUCKET
      - FIREBASE_MESSAGINGSENDERID
      - FIREBASE_TENANT=tilechat
      - UPLOAD_ENGINE=native
      - "API_URL=${EXTERNAL_BASE_URL}/api/"
      - "TRANSLATIONS_URL=${EXTERNAL_BASE_URL}/api/"
      #- API_BASEIMAGE_URL=https://firebasestorage.googleapis.com/v0/b/    For firebase
      - "API_BASEIMAGE_URL=${EXTERNAL_BASE_URL}/api/"
      - AUTH_PERSISTENCE=LOCAL
  ionic:
   image: chat21/chat21-ionic:3.0.58.1
   container_name: chat21-ionic
   ports:
      - "8180:80" #use expose if you want to block external access   
   environment: 
      - DASHBOARD_URL=/dashboard/      
      - API_BASEIMAGE_URL=/api/
      - API_URL=/api/
      - PUSH_ENGINE=none
      - LOG_LEVEL=info
      - FILE_UPLOAD_ACCEPT=*/*
      - CHAT21_ENGINE=mqtt
      - MQTT_APPID=tilechat
      - "MQTT_ENDPOINT=${EXTERNAL_MQTT_BASE_URL}/mqws/ws"
      - MQTT_APIENDPOINT=/chatapi/api
      #- MQTT_LOGINSERVICE_ENDPOINT=/api/chat21/native/auth/createCustomToken
      - UPLOAD_ENGINE=native
      - FIREBASE_APIKEY
      - FIREBASE_AUTHDOMAIN
      - FIREBASE_DATABASEURL
      - FIREBASE_PROJECT_ID
      - FIREBASE_STORAGEBUCKET
      - FIREBASE_MESSAGINGSENDERID
      - FIREBASE_TENANT=tilechat
      - FIREBASE_VAPID
  proxy:
    image: tiledesk/tiledesk-docker-proxy
    container_name: tiledesk-docker-proxy   
    ports:
      - "4180:80" # specify port forewarding
    depends_on:
      - server
      - dashboard
      - webwidget
      - chat21httpserver
      - rabbitmq
    command: [nginx-debug, '-g', 'daemon off;']
    
  server:
    image: tiledesk/tiledesk-server:2.2.8
    container_name: tiledesk-server
    restart: always       
    environment: 
      - LOG_LEVEL=verbose
      - CHAT21_ENABLED=true
      - CHAT21_ENGINE=mqtt
      - CHAT21_URL=http://chat21httpserver:8104
      - CHAT21_JWT_SECRET=tokenKey
      - CHAT21_APPID=tilechat
      - RESTHOOK_ENABLED=true
      - CHAT21_ADMIN_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNDU2MTBkNy03MmYxLTQ5OWUtODQzMS0xMTNhZWJkOWVmOTgiLCJzdWIiOiIxMDAtQVBJQURNSU4iLCJzY29wZSI6WyJyYWJiaXRtcS5yZWFkOiovKi8qIiwicmFiYml0bXEud3JpdGU6Ki8qLyoiLCJyYWJiaXRtcS5jb25maWd1cmU6Ki8qLyoiXSwiY2xpZW50X2lkIjoiMTAwLUFQSUFETUlOIiwiY2lkIjoiMTAwLUFQSUFETUlOIiwiYXpwIjoiMTAwLUFQSUFETUlOIiwidXNlcl9pZCI6IjEwMC1BUElBRE1JTiIsImFwcF9pZCI6InRpbGVjaGF0IiwiaWF0IjoxNjE0OTQzNDkyLCJleHAiOjE5MjU5ODM0OTIsImF1ZCI6WyJyYWJiaXRtcSIsIjEwMC1BUElBRE1JTiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJhZG1pbiJ9.KptGMsTKjd3wUiiP1GGSTYqW1XXK1vjSRJnetC3wjxU
      - MONGODB_URI=mongodb://mongo/tiledesk
      - EMAIL_ENABLED
      - EMAIL_HOST
      - EMAIL_USERNAME
      - EMAIL_SECURE
      - EMAIL_PORT
      - EMAIL_PASSWORD
      - EMAIL_FROM_ADDRESS
      - "EMAIL_BASEURL=${EXTERNAL_BASE_URL}/dashboard"
      - "WEBHOOK_ORIGIN=${EXTERNAL_BASE_URL}/api/"
      - "WIDGET_LOCATION=${EXTERNAL_BASE_URL}/widget/launch.js"
      - "WIDGET_TEST_LOCATION=${EXTERNAL_BASE_URL}/widget/assets/test_widget_page/index.html"
      - WS_SERVER_PATH      
    depends_on:
      - mongo
    ports:
      - "4300:3000"

  chat21httpserver:
    image: chat21/chat21-http-server:0.1.39
    container_name: chat21httpserver
    restart: always    
    environment: 
      - LOG_LEVEL=info
      #- AUTO_RESTART=false
      - MONGODB_URI=mongodb://mongo/chat21
      - JWT_KEY=tokenKey
      - RABBITMQ_URI=amqp://ignored:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2YWI3MzY1Yi1hYWRhLTRlNTktOWZjZS0yMDQwZDgyOTA4MTgiLCJzdWIiOiIxMDAtQVBJQURNSU4iLCJzY29wZSI6WyJyYWJiaXRtcS5yZWFkOiovKi8qIiwicmFiYml0bXEud3JpdGU6Ki8qLyoiLCJyYWJiaXRtcS5jb25maWd1cmU6Ki8qLyoiXSwiY2xpZW50X2lkIjoiMTAwLUFQSUFETUlOIiwiY2lkIjoiMTAwLUFQSUFETUlOIiwiYXpwIjoiMTAwLUFQSUFETUlOIiwidXNlcl9pZCI6IjEwMC1BUElBRE1JTiIsImFwcF9pZCI6InRpbGVjaGF0IiwiaWF0IjoxNTk0Mzc3OTc4LCJleHAiOjE2OTY5Njk5NzgsImF1ZCI6WyJyYWJiaXRtcSIsIjEwMC1BUElBRE1JTiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJhZG1pbiJ9.g2YL6RZp5SuLcQyBTYf4cn9SnRIyifNb1f1-Si1inbs@rabbitmq:5672?heartbeat=60
    depends_on:
      - mongo
      - rabbitmq
    ports:
      - "8104:8004"

  chat21server:
    image: chat21/chat21-server:0.1.14
    container_name: chat21server
    restart: always
    environment: 
      #- AUTO_RESTART=false
      - LOG_LEVEL=info
      - MONGODB_URI=mongodb://mongo/chat21
      - APP_ID=tilechat
      - WEBHOOK_ENDPOINT=http://server:4300/chat21/requests
      - WEBHOOK_ENABLED=true
      - WEBHOOK_EVENTS=message-sent
      - RABBITMQ_URI=amqp://ignored:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMDI2NjU0Ni05ZGMxLTQ3MzgtOWE5OC01OTQwYWFmZWJkMjgiLCJzdWIiOiIwMS1PQlNFUlZFUiIsInNjb3BlIjpbInJhYmJpdG1xLnJlYWQ6Ki8qLyoiLCJyYWJiaXRtcS53cml0ZToqLyovKiIsInJhYmJpdG1xLmNvbmZpZ3VyZToqLyovKiJdLCJjbGllbnRfaWQiOiIwMS1PQlNFUlZFUiIsImNpZCI6IjAxLU9CU0VSVkVSIiwiYXpwIjoiMDEtT0JTRVJWRVIiLCJ1c2VyX2lkIjoiMDEtT0JTRVJWRVIiLCJhcHBfaWQiOiJ0aWxlY2hhdCIsImlhdCI6MTU5Mzg1OTgzNiwiZXhwIjoxNjk2NDUxODM2LCJhdWQiOlsicmFiYml0bXEiLCIwMS1PQlNFUlZFUiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJ1c2VyIn0.N6bs-WXVZJTNW2jztzph4SYc9_Szs0cb0kBM9n0k8hY@rabbitmq:5672?heartbeat=60
    depends_on:
      - mongo
      - rabbitmq
      - server 
  rabbitmq:
    image: chat21/chat21-rabbitmq
    container_name: rabbitmq
    environment:
        RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_ERLANG_COOKIE}
        RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
        RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
    ports:
        - 4672:5672
        - 4872:15672
        - 4883:1883
        - 5675:15675
    # healthcheck:
    #     test: [ "CMD", "nc", "-z", "localhost", "5672" ]
    #     interval: 5s
    #     timeout: 15s
    #     retries: 1
  mongo:
    container_name: mongo
    image: mongo:4.0.23
    command: --bind_ip_all
    volumes:
      - tiledesk-datadb:/data/db    
   
  mongo-express:
    image: mongo-express
    environment:
        - ME_CONFIG_MONGODB_SERVER=mongo
        - ME_CONFIG_MONGODB_PORT=27017
        - ME_CONFIG_MONGODB_ENABLE_ADMIN=true
        - ME_CONFIG_MONGODB_AUTH_DATABASE=tiledesk
        - ME_CONFIG_MONGODB_AUTH_USERNAME=${MONGO_ROOT_USER}
        - ME_CONFIG_MONGODB_AUTH_PASSWORD=${MONGO_ROOT_PASSWORD}
        - ME_CONFIG_BASICAUTH_USERNAME=${MONGOEXPRESS_LOGIN}
        - ME_CONFIG_BASICAUTH_PASSWORD=${MONGOEXPRESS_PASSWORD}
    depends_on:
        - mongo
    ports:
      - "8181:8081"

  #ngrok:
  #  container_name: ngrok
  #  image: wernight/ngrok
  #  command: ngrok http server:3000    
  #  ports:
  #   -  '4040:4040'

i added the mongo-express to check some things, the databases and collections exists on mongo, and the user admin@tile... exists, but when i try to login i (POST http://myip:4150/api/auth/signin) got the response:
405 Not Allowed

any idea?

@juanbits
Copy link
Author

actually if i send a PUT request via web GUI to recover password (PUT http://myip:4150/api/auth/requestresetpsw ) I got the same response:
405 Not Allowed

@juanbits
Copy link
Author

I think the error resides on the nginx service, because is mapped to the port 80 on my $host and my $host have used the port 80, how can I modify the nginx service port to deploy tiledesk on a dedicated-shared server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant