#Docker not installing Node Modules

1 messages · Page 1 of 1 (latest)

keen ginkgo
#

I am trying to deploy my express.js MongoDB application on an ubuntu vps using docker however docker tells me this when I use docker compose up I have a mongoDB service dependent on the express.js application as well.

my Dockerfile looks like this

# USE ALPINE LINUX
FROM node:alpine 
# CREATE A WORKING DIR
WORKDIR /user/src/app
# COPY package.json to working dir
COPY package*.json .
# install packages
RUN npm ci
# copy everything from here to working dir
COPY . .

# Development

# CMD ["npm", "run", "dev"]

# Production
CMD [ "npm", "start" ]
#

and docker compose file looks like this

version: '3.9'
services:
  # MongoDB service
  mongodb:
    container_name: db_container
    image: mongo:latest
    restart: always
    ports:
      - 2717:27017
    volumes:
      - mongodb:/data/db

  # Node.js Api container
  api:
    build: .
    ports:
      - 3002:3002
    volumes:
      - .:/user/src/app
    environment:
      PORT: 3002
      NODE_ENV: PRODUCTION
      LOG_LEVEL: debug
      DBURL: mongodb://mongodb/
      JWT_SECRET: password
      SES_USER: session
      SES_PASS: session_pass
      WEB_BASE_URL: http://api:3002
    depends_on:
      - mongodb

volumes:
  mongodb: {}
keen ginkgo
#

@near lodge not sure whats the issue here super confused

near lodge
#

Okay

near lodge
keen ginkgo
#

yeah I figured out what the issue was

#

had to remove volumes: - .:/user/src/app

near lodge
#

Ah i see

keen ginkgo
#

how do i close the help forum

near lodge
keen ginkgo