-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Labels
enhancementNew feature or requestNew feature or request
Description
Description
I run vite inside a docker container for security reasons.
My docker run
looks like:
docker container run -d --rm --name "myApp" \
-v "~/myApp:/var/www/myApp:ro" \
-v "~/myApp/tmp:/var/www/myApp/tmp:rw" \
-v "~/myApp/logs:/var/www/myApp/logs:rw" \
-v "~/myApp/package-lock.json:/var/www/myApp/package-lock.json:rw" \
"myApp:latest"
As you can see, the application code files are read-only and they can't be changed from inside the docker container (for example, some mistake like rm -rf *
can't remove all my code files).
But since version 3.0.1, vite build
creates the vite.config.js.mjs
file in the root directory, and since version 3.0.3 it creates a file with a random name like vite.config.js.timestamp-1659277944620.mjs
.
Because my application root is the read-only, then docker container exec -i "myApp" bash -l -c 'npm run build'
fails with error:
failed to load config from /var/www/myApp/vite.config.js
error during build:
Error: EROFS: read-only file system, open '/var/www/myApp/vite.config.js.timestamp-1659277944620.mjs'
Suggested solution
Write file only to explicitly set directories.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
sanmai-NL, IronGeek, forceuser, mayank99, stazz and 30 moretonyfromundefined and silverwind
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request