version: '3'
services:
  mongo:
    container_name: mongo
    image: mongo
    ports:
      - '27017:27017'
    volumes:
      - mongodb:/.local/db/data/db
  app:
    container_name: docker-node-mongo
    restart: always
    build: ./app/server
    ports:
      - '80:3000'
    links:
      - mongo
    environment:
      - PORT=3000
      - MONGODB_URL=mongodb://mongo:27017/todo-app
      - JWT_SECRET=myjwtsecret

volumes:
  mongodb: