LoginSignup
1
0

More than 1 year has passed since last update.

node+dockerでbcryptしたら、エラーおきた

Last updated at Posted at 2020-09-28

dockerとnodeの環境でbcryptライブラリを使ったときのエラー

dockerでnodeでbcryptを使うとエラーが起きます。
node_modulesをコピーしてしまうとエラーが起きるので、.dockerignoreを使いましょう

dockerignoreを使いましょう

tree
.
├── Dockerfile
├── app.js
├── node_modules
├── package-lock.json
├── package.json
└── .dockerignore ←これを追加
.dockerignore
node_modules/

ちなみにDockerfileはこんな感じ

FROM node:12
WORKDIR /usr/src/app

COPY package.json ./
COPY package-lock.json ./
RUN npm install

COPY . .

CMD [ "npm", "start" ]
1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0