Hi! I am new to Docker and I’ve created React (Vite) app. I created an image, used GitHub actions to push it to Docker hub.
However, url request in running container gets prefixed with my localhost and then /VITE_API_URL=…
I’m running my container with --env-file .env, Dockerfile is simple (copy, npm i, npm run build, expose, cmd npm run preview) and in yml i tried echo of the GitHub secret I set up (secrets → actions → repository secrets).
I don’t know if I provided enough data, but I would really appreciate all the help or hints.
yml .env creation:
- name: Create .env file with secrets
run: |
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" >> .env