正在处理使用MRE SDK.的应用。应该注意的是,如果不是文件编辑(从某个node_module类中删除readonly
),则最新版本存在一些构建问题。
通过npm start
运行时,该应用程序运行良好,但我需要将其放入带有postgres数据库的docker容器中。以下是我的docker-compose.yml:
version: "3.7"
services:
db:
image: postgres:9.6-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pg_paassword
networks:
internal:
volumes:
- "dbdata:/var/lib/postgresql/data"
app:
build:
context: .
dockerfile: Dockerfile
environment:
PGUSER: user
PGPASSWORD: pg_paassword
PGHOST: db
networks:
internal:
ports:
- 3901:3901
networks:
internal:
volumes:
dbdata:
这是我的dockerfile:
FROM node:10.16-alpine
WORKDIR /opt/mre
COPY package*.json ./
RUN ["npm", "install", "--unsafe-perm"]
COPY public ./public/
COPY tsconfig.json ./
COPY src/*.ts ./src/
COPY v0.16_mre_fix/* node_modules/@microsoft/mixed-reality-extension-sdk/built/animation/
RUN ["npm", "run", "build"]
EXPOSE 3901/tcp
CMD ["npm", "start"]
不幸的是,尽管docker-compose build
进展顺利,但docker-compose up
却没有:
Error: Cannot find module './userInternal'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/opt/mre/node_modules/@microsoft/mixed-reality-extension-sdk/built/user/user.js:9:24)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
我不确定该怎么办;至少在项目文件夹本身中,存在node_modules文件夹。 userInternal.js
也是如此。我有什么想念的吗?