Have a look at the documentation. You can have a .env file which picks up the PUBLIC_URL
Although you should remember that what its used for -
You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application.