Andasy builds failing to start on windows

8

I was deploying my react app and failed with this, what could be the issue? how can i handle it?

Hi @gishomahub , can you try to deploy again?

it is giving same error!

Okay, could you try deploying using GitHub Actions?
You can follow this guide for the setup: Auto Deploy with GitHub Action

Also, make sure to exclude any unnecessary large files (e.g., .rar, node_modules, etc.) from the build context by adding them to a or .gitignore, .dockerignore file, as they can cause build failure.

Hello, I have tried this with more configs and it worked,
but now the issue how to handle environment variables without exposing them publicly, consider env is ignored while pushing and now i’m building with github action?

Hello @gishomahub, if your environment are used in your runtime you can use secrets to add them, read more here.

If your environments are required in build time (most common in Nextjs build) you can add them in your Dockerfile before the build command

they are build time for react js, and i’m using github action to deploy as andasy deploy is failing, how to handle these env? can list all steps to go through?

You can add the required environment in your Dockerfile before the build statement.
Example:

// previous dockerfile content
ENV VITE_API_URL=http://localhost:3000/
RUN npm run build
// rest of dockerfile content

Variables that are secret should not be in the build stage as they are injected in the output of the built files so they should be fine since they are loaded at runtime only (these are the one that are not public starting with VITE_). Search for ways to load env at runtime according to the framework you are using there are packages that handle those cases.

Hello, how to achieve this without hardcoding env variables, i do not want to push them directly to github?

Unfortunately we haven’t added a possibility to pass build arguments to docker during a build so for now you will have to refactor your app to load environments at runtime if you don’t want to push them to GitHub.
We are building a secure way to manage that in both our remote and local builders and GitHub actions, in the next cli releases it should be included out of the box.

Thank you for clarification, let me work on that recomendation.