trynmaps / metrics-mvp

Prototype of public transit data visualization system
https://muni.opentransit.city
MIT License
30 stars 34 forks source link

Allow frontend to load from nginx deployment #664

Closed EddyIonescu closed 3 years ago

EddyIonescu commented 3 years ago

A previous PR (#613) broke viewing the frontend when deployed on nginx by changing the homepage from frontend/build to https://muni.opentransit.city. This PR resolves this by setting the PUBLIC_URL environment variable to frontend/build when running npm run build from the Dockerfile, which is used for all server deployments including Google Cloud, Heroku, and by future users who want to deploy OpenTransit on their own server using our Docker setup.

The static S3 serverless approach continues to work for muni.opentransit.city but requires modifying the URLs in frontend/package.json and in frontend/public/CNAME for deploying a static site for other agencies or environments which we don't officially support or document as of yet.