在docker-compose中,我习惯以以下方式创建卷:
为了解决
我创建了以下配置:
但是它无法运行。node_modules文件夹为空。
volumes:
- ./server:/home/app
- /home/app/node_modules
为了解决
node_modules
的问题,我该如何在 Kubernetes 中处理?我创建了以下配置:
spec:
containers:
- env: []
image: "image"
volumeMounts:
- mountPath: /home/app
name: vol-app
- mountPath: /home/app/node_modules
name: vol-node-modules
name: demo
volumes:
- name: vol-app
hostPath:
path: /Users/me/server
- name: vol-node-modules
emptyDir: {}
但是它无法运行。node_modules文件夹为空。