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

volumes:
  mongodb: