I intend to create docker build for my node.js app. The build context is a remote git url with a docker file. When I run docker-compose up --build
, it builds the app successfully but I get an error, npm ERR! path /code/package.json
My dockerfile
FROM node:16.15.0 as develop-stage
WORKDIR /code
COPY package.json .
# Using package-lock file to fix the version of installed modules.
COPY package-lock.json .
RUN npm install
COPY . .
My docker-compose
version: '3.8'
services:
my-service:
container_name: my-service
build:
context: 'https://username:token@bitbucket.org/abc/test-repo'
dockerfile: Dockerfile
volumes:
- .:/code
- /code/node_modules
command: nodemon index.js
networks:
- my-network
expose:
- 9608
ports:
- 9608:9608
restart: on-failure
volumes:
my-data:
external: false
networks:
my-network:
external: false