The deployed bundle had no API base URL baked in at all, so the app fell back to relative /api/* requests, which the frontend's nginx forwards to a backend:8000 service that does not exist in this deployment. Same cause as the backend: Dokploy writes its own .env into the build context from the service's Environment tab after cloning, and that tab is empty, so the committed file was replaced by a zero-byte one. The checkout showed .env at 0 bytes, and grepping the running container's bundle for the API host returned nothing. Vite loads .env.production for production builds and it takes precedence over .env, so the config now travels under that name and survives. No Dockerfile change is needed - Vite resolves it natively - and the --build-arg stays unnecessary. Verified by writing an empty .env over the checkout, exactly as Dokploy does, and building: https://mcp.nearle.ai.in is still inlined into the bundle. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
# Logs
|
|
logs
|
|
*.log
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
yarn-error.log*
|
|
pnpm-debug.log*
|
|
lerna-debug.log*
|
|
|
|
node_modules
|
|
dist
|
|
dist-ssr
|
|
*.local
|
|
|
|
# .env.production is committed deliberately. It holds only VITE_API_BASE_URL,
|
|
# which Vite inlines into the public bundle anyway - visible to anyone who opens
|
|
# the site - so ignoring it protected nothing, and committing it means the deploy
|
|
# does not depend on remembering a --build-arg.
|
|
#
|
|
# The name matters. Dokploy writes its own .env into the build context from the
|
|
# service's Environment tab after cloning, so a committed .env is silently
|
|
# replaced - with an empty file when that tab is blank, which is exactly what
|
|
# left the deployed bundle with no API URL at all. Vite loads .env.production
|
|
# for production builds and it takes precedence over .env, so this survives.
|
|
#
|
|
# Anything genuinely secret must NOT go in a VITE_-prefixed variable: it would
|
|
# be published in the bundle. Use .env.local (still ignored) for local
|
|
# overrides.
|
|
!.env.production
|
|
.env
|
|
.env.local
|
|
|
|
# Editor directories and files
|
|
.vscode/*
|
|
!.vscode/extensions.json
|
|
.idea
|
|
.DS_Store
|
|
*.suo
|
|
*.ntvs*
|
|
*.njsproj
|
|
*.sln
|
|
*.sw?
|
|
|
|
.env.development
|