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

API Subdomain breaks docker images #10

Closed
encima opened this issue Mar 21, 2021 · 4 comments
Closed

API Subdomain breaks docker images #10

encima opened this issue Mar 21, 2021 · 4 comments

Comments

@encima
Copy link

encima commented Mar 21, 2021

Currently, the docker instructions do not match the latest version of the code (unless you have a host set up)

gristUrls has a default subdomain of 'api' which, when run with docker, will prepend api with the IP of the host.

i.e.
image

Could we use the api route by default instead and make this configurable through an environment variable, perhaps?

@paulfitz
Copy link
Member

Thanks for the heads-up @encima. Just so I understand, do you have trouble if you visit http://localhost:8484 after running this:

docker pull gristlabs/grist
docker run -p 8484:8484 -it gristlabs/grist

If you know the IP address that grist will ultimately be served on, you can set some environment variables to let it know. Would this work for you?:

export IP=192.168.1.153
docker run -p 8484:8484 \
       --env GRIST_SINGLE_PORT=true \
       --env GRIST_HOST=0.0.0.0 \
       --env GRIST_SINGLE_ORG=docs \
       --env GRIST_DOMAIN=$IP \
       --env APP_HOME_URL=http://$IP:8484 \
       --env APP_DOC_URL=http://$IP:8484 \
       -it gristlabs/grist

I agree it'd be better if this worked straight out of the box, without the api logic confounding things. We also also documentation of environment variables we should make public...

@encima
Copy link
Author

encima commented Mar 22, 2021

I did find the environment variables so that part was ok. but just running with local host causes an issue because connection string tries api.localhost and fails.

also, when I set the IP under APP_HOME etc then the api will then try api.168.1.2 instead of api.$IP. Both would fail but I guess the regex is just splitting at the first "."?

@paulfitz
Copy link
Member

Would it be possible to describe exactly how you are running Grist? Then I could help suggest environment variable changes that might help you. Variables that may be relevant include GRIST_SINGLE_PORT, GRIST_SINGLE_ORG, and GRIST_ORG_IN_PATH. Accesses to api.* should be fixable with a configuration matching the situation (running a single server handling all responsibilities, and perhaps for a single hard-coded organization).

@encima
Copy link
Author

encima commented Apr 5, 2021

Sorry for the delay here! I did switch to paying for an account with your hosted version but would still like a mirrored, self hosted version.

Currently, I am deploying all in a single container with a Lets Encrypt proxy pointing to the grist domain

I tested running on my local machine and all works fine so I assume it is something with the proxy (or Caprovers port mapping); I will close now and update if I do succeed in running it this way.

@encima encima closed this as completed Apr 5, 2021
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

2 participants