我正在使用 Vue 对接一个 Vite 应用程序。当我yarn dev
从系统运行时,一切正常,但是当我从 dockerfile 启动相同的命令时,出现以下错误
yarn run v1.22.5
warning package.json: No license field
$ vite
failed to load config from /app/vite.config.ts
error when starting dev server:
Error: spawn Unknown system error -8
我的 dockerfile 是
FROM node:14.16.0-alpine3.13
WORKDIR /app
COPY . .
CMD ["yarn", "dev"]
我的 docker-compose.yml 是
version: '3.8'
services:
client:
build:
context: ./dockerfiles
dockerfile: client.dockerfile
volumes:
- ./client:/app
ports:
- '3000:3000'
我的文件夹结构是
client
|-public
|-src
|-node_modules
|-package.json
|-vite.config.ts
|- ... rest of files
dockerfiles
|-client.dockerfile
docker-compose.yml (at root level)