docker-compose.yml 525 Bytes
Newer Older
1 2 3 4 5
version: '3'

services:
  app:
    working_dir: /usr/src/app
6
    # command: npm start
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    build: .
    depends_on:
      - db
    volumes:
      - node_modules:/usr/src/app/node_modules:cached
      - ./:/usr/src/app:cached
    ports: 
      - "8082:3000" #host:container, 3000 is the default port of Express.js
    stdin_open: true
    tty: true

  db:
    image: bitnami/mongodb
    volumes:
      - ./db_data:/bitnami/mongodb
      - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js

volumes:
  node_modules: