diff --git a/waspc/packages/deploy/src/providers/fly/deploy/deploy.ts b/waspc/packages/deploy/src/providers/fly/deploy/deploy.ts index 4dd3713ac3..222cdeab95 100644 --- a/waspc/packages/deploy/src/providers/fly/deploy/deploy.ts +++ b/waspc/packages/deploy/src/providers/fly/deploy/deploy.ts @@ -103,8 +103,13 @@ async function deployClient(deploymentInfo: DeploymentInfo, { bui copyProjectClientTomlLocally(deploymentInfo.tomlFilePaths); waspSays('Building web client for production...'); + waspSays('If you configured a custom domain for the server, you should run the command with an env variable: REACT_APP_API_URL=https://serverUrl.com wasp deploy fly deploy'); + + const serverUrl = process.env.REACT_APP_API_URL + ? process.env.REACT_APP_API_URL + : deploymentInfo.serverUrl; await $`npm install`; - await $`REACT_APP_API_URL=${deploymentInfo.serverUrl} npm run build`; + await $`REACT_APP_API_URL=${serverUrl} npm run build`; // Creates the necessary Dockerfile for deploying static websites to Fly.io. // Adds dummy .dockerignore to supress CLI question.