Skip to content

🐛 fix(docker): write .env file for Vite during production build#71

Merged
656d696c65 merged 2 commits intomainfrom
local-emile-development
Mar 12, 2026
Merged

🐛 fix(docker): write .env file for Vite during production build#71
656d696c65 merged 2 commits intomainfrom
local-emile-development

Conversation

@656d696c65
Copy link
Member

Vite reads VITE_* variables from .env files, not from process.env. The production Dockerfile was setting them via ENV directives, which had no effect on import.meta.env in the built output.

  • Move ARG declarations into the build stage where they are used
  • Write VITE_* build args to packages/website/.env before building
  • Remove unused ENV directives for Vite variables
  • Pass VITE_API_BASE_URL and VITE_WEBSITE_BASE_URL from GitHub Actions variables into the publish workflow build step

&mile and others added 2 commits March 12, 2026 18:43
Vite reads VITE_* variables from .env files, not from process.env.
The production Dockerfile was setting them via ENV directives, which
had no effect on import.meta.env in the built output.

- Move ARG declarations into the build stage where they are used
- Write VITE_* build args to packages/website/.env before building
- Remove unused ENV directives for Vite variables
- Pass VITE_API_BASE_URL and VITE_WEBSITE_BASE_URL from GitHub
  Actions variables into the publish workflow build step
@656d696c65 656d696c65 merged commit f4984b9 into main Mar 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant