ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.23k stars 527 forks source link

[Question] Please help me with webapp trying from last few days without any success #7896

Open weir1 opened 3 months ago

weir1 commented 3 months ago

Hi guyz, Please help me with this issue, I am trying my best from last 2 days I am running everygauzy on a server I created new lxc dedicated to evergauzy with docker evergauzy easily connecting with windows desktop app its just webapp i am having issues with guys please dont close ticket, & help me solve this issue

I am very very super f*cing tired but still this problem isnt resolving

Screenshot 2024-06-24 235603

despite change env to my ip or domain name it still requesting to

http://localhost:3000/api/auth/authenticated

its beyond my mind

although my api is connecting fine with windows desktop app, without any issue

its just webapp i am struggling with

adding my env file .env.compose

`# Docker Compose sample .env file for Production

NODE_ENV=production

The name of the application.

APP_NAME="DigiTech-Marketing"

The URL for the application logo.

APP_LOGO="https://digitech-marketing.com/wp-content/uploads/2019/08/Digitech.png"

The signature or tagline for the application.

APP_SIGNATURE="Convert Click Into Customer"

The link to the application.

APP_LINK="http://hrm.automindx.com"

The URL for email confirmation in the application.

APP_EMAIL_CONFIRMATION_URL="http://hrm.automindx.com/#/auth/confirm-email"

The URL for magic sign-in in the application.

APP_MAGIC_SIGN_URL="http://hrm.automindx.com/#/auth/magic-sign-in"

set true if running inside Docker container

IS_DOCKER=true

API Host

API_HOST=api

API Port

API_PORT=3000

WEB UI Host

WEB_HOST=webapp

WEB UI Port

WEB_PORT=4200

set true if running as a Demo

DEMO=false

DO (DIGITALOCEAN), AWS, AZURE, CIVO, CW (COREWEAVE), HEROKU, LINODE, LOCAL, OVH, SCALEWAY, VULTR, etc

CLOUD_PROVIDER=

ALLOW_SUPER_ADMIN_ROLE=true

set to Gauzy API base URL

API_BASE_URL=http://crm-api.automindx.com

set to Gauzy UI base URL

CLIENT_BASE_URL=http://hrm.automindx.com

set to Website Platform

PLATFORM_WEBSITE_URL=https://digitech-marketing.com PLATFORM_WEBSITE_DOWNLOAD_URL=https://digitech-marketing.com/about-us/`

 

evereq commented 3 months ago

How do you run it, with what Docker compose command exactly?

evereq commented 3 months ago

@weir1 I think when the frontend starts inside Docker, it must be running the correct Docker Entrypoint file that replaces (substitutes) values for env vars in our JS code! See https://github.com/ever-co/ever-gauzy/blob/develop/.deploy/webapp/entrypoint.compose.sh. For example,

sed -i "s#DOCKER_API_BASE_URL#$API_BASE_URL#g" *.js

That should make a "trick" and replace default localhost with your env var value and make client code connect to correct API endpoint...

So something goes off here...

That's why asking how you run Docker compose exactly?

weir1 commented 3 months ago

How do you run it, with what Docker compose command exactly?

simply I use docker-compose up -d i use this because i want to run it as production

I am using docker from proxmox helper script to start lxc container under proxmox

I am making changes in .env.compose only

evereq commented 3 months ago

OK, so we never tried to run THIS app in production with docker compose and it's possible that some things are not working in that replacement of env vars when you try to change from localhost to your specific host URL... I will have to check by running it locally and see the output when entrypoint commands are executed. I added some more logging ("Is Running in Docker") to see if it correctly detects and try to replace env vars or not... Pushed to develop branch, but it will take a while till we get it merged to master... and it might need more fixes.

evereq commented 3 months ago

For production, I think best would be to either run k8s or maybe just run manually only those Docker images that you need?

weir1 commented 3 months ago

For production, I think best would be to either run k8s or maybe just run manually only those Docker images that you need?

I just want webapp to run with all of features so that i can start running crm without any issues so should I install manually via linux or "only those Docker images that you need" i didnt quite get this

evereq commented 3 months ago

It should be relatively simple to run webapp - you select the required env vars (same as in Docker-compose, you have a list there) and just run our prebuild image (again referred in docker-compose file too) and use the correct entrypoint file (which when run should replace env vars!!!)

weir1 commented 3 months ago

It should be relatively simple to run webapp - you select the required env vars (same as in Docker-compose, you have a list there) and just run our prebuild image (again referred in docker-compose file too) and use the correct entrypoint file (which when run should replace env vars!!!)

so without compose file run container INDIVIDUALLY? right?

evereq commented 3 months ago

Yes.

Basically, we need to trace how that "replacement" working when you run it with Docker compose as I think that's a major issue you having! And that can be done either by reviewing tons of logs of docker-compose when it runs entrypoint code OR when you run it as individual docker container with correct env vars (specifically one of most important is IS_DOCKER and it must be set to true to make sure that entrypoint code correctly replace env vars defined in the "template" code)

weir1 commented 3 months ago

Yes.

Basically, we need to trace how that "replacement" working when you run it with Docker compose as I think that's a major issue you having! And that can be done either by reviewing tons of logs of docker-compose when it runs entrypoint code OR when you run it as individual docker container with correct env vars (specifically one of most important is IS_DOCKER and it must be set to true to make sure that entrypoint code correctly replace env vars defined in the "template" code)

I tried running container indidvualy but its closing soon

what else is there method apart from docker k8s , i can instally gauyzy? Ever® Gauzy™ Server includes Gauzy API, SQLite DB (or connects to external PostgreSQL) and serves Gauzy frontend. It allows to quickly run Gauzy Server for multiple clients (browser based or Desktop based).

I am seeing other linux server

I will try that

will it work there?

evereq commented 3 months ago

If container is closing there are ways to see why (i.e. what failing, google for it) Re Ever Gauzy Server - try on your server, but you have to have there UI enabled, not only command prompt access :)

Hari01010 commented 3 months ago

Hi Weir1. I am answering by assuming that "you configured env vars correctly as per your requirements in .env.compose file".

This answer might seems weird to you but it will work. Keep backup of .env file if it is already existed . Just create .env file by using "cp .env.compose .env" and make sure to replace .env.compose file name in your docker compose production file of environment file field with .env then start docker compose.

evereq commented 3 months ago

hm, that's interesting @Hari101010 , maybe that can help if both .env.compose and .env exists? In such case I think .env can "override" values defined in .env.compose.... Btw, similar issues can be with .env.local file too.