Open fazley-kholil-cko opened 6 years ago
Hey @fazley-kholil-cko, can you show environment variables you are using to start web and api containers? Check out .env.example
file, it has inline docs on env variables: https://github.com/Nebo15/gandalf.api/blob/master/.env.example
@fazley-kholil-cko , Please follow below steps
API Installation Process 1 Clone https://github.com/Nebo15/gandalf.api
Web Installation Process
Go to code directory
Create a new file .env and add variable PORT, API_ENDPOINT, API_CLIENTID, API_CLIENTSECRET, PROVIDERS_BUGSNAG_APIKEY, PROVIDERS_BUGSNAG_STAGE
Update .env file as below PORT=8080 API_ENDPOINT=http://gandalf.api API_CLIENTID=d82f82004384c8835454603277bed410 API_CLIENTSECRET=+0+~^db49+R9WX%sdS~-EsZrK!'uVe;H PROVIDERS_BUGSNAG_APIKEY= PROVIDERS_BUGSNAG_STAGE=
Run below command Npm install npm i -g bower gulp bower install gem install compass Make sure all command executed successfully, If you get any error, try to install all dependency and related library. Otherwise application will not work
gulp ## build and open Gandalf on http://localhost:8080 and watch file changes
FYI @AndrewDryga
@AndrewDryga i have put the environment variable in the docker compose
@kumarsujendra Thanks for the help.
@kumarsujendra I followed your steps, and everyone was successfully accomplished, but I have troubles seen the Gandalf.API service, I testing with curl in port 9000, but i get nothing, any ideas?
the php-fpm is on , I see the port open and acceping requests and the php-fpm pointed to the folder where the project is it.
@Gabo-LTM ,
Try debugging API_ENDPOINT url and make sure this returns "OK" response. Otherwise Web will not work correctly. Because Web use web service and API_ENDPOINT process same in back-end
Check step 4 in Web Installation Process and update API_ENDPOINT=http://gandalf.api correctly.
There is a files in web installation directory server/index.js . This need to be run by PM2 service.
On my local server I use npm start server/index.js . When you hit this command in console, this will take some time and show output as Gandalf is running on localhost:8080
Open http://localhost:8080 or http://your_server_id:8080/ and input credentials (demo/demo) to login.
@kumarsujendra
permission checked, I include an .htaccess file in public directory and restart the api server. The url doesn't return ok (see below)
env file checked, the API server is in another server (see below)
I usually launch with gulp , but I tried this way and same result (fist image with gulp, second directly with npm)
I tested the demo/demo user and same result
the only difference is I used the docker container and configure it, I'll try make the gandalf.api from the ground.
any advice is welcome
@Gabo-LTM ,
Basically you have problem with API installation. API endpoint is http://172.17.0.2:9000/ This should return "OK" response. API end point is based on Lumen framework and should worked separately. It uses MongoDb database. Check .ENV file and make sure you have done DB migration correctly.
Run DB migration script $ php artisan migrate --seed – This will migrate database related configuration in database Browse mongodb server and verify database tables created. Browse auth table and copy API_CLIENTID and API_CLIENTSECRET. This will be use in web configuration
Why not you use http://172.17.0.2:80 for API and http://172.17.0.2:8080 for web Apache/Nginx default port default is 80 and I think you should use default port. Docker compose file uses default port for Apache/Nginx as mentioned here
Hi guys, Need some help, the db migration scripts is not working on the api container.
I successfully managed to run both gandalf.api and gandalf.web. However the web is not being able to communicate with the api. I can see from previous issues that we must run some migration scripts on the db. Can you please advice how to run those migration scripts. Is it the mongo scriots or php??