version: '3'

services:
  mongodb:
    restart: unless-stopped
    image: mongo:latest
    container_name: noodlapp-mongodb
    ports:
      - "27017:27017"
    volumes:
      - mongodb-data:/data/noodlapp-db
    environment:
      MONGO_INITDB_ROOT_USERNAME: yourusername
      MONGO_INITDB_ROOT_PASSWORD: yourpassword
      MONGO_INITDB_DATABASE: noodlapp

  cloudservice:
    restart: unless-stopped
    build:
      context: .
      dockerfile: Dockerfile
    container_name: cloudservice
    environment:
      NODE_ENV: production
      PORT: 3000
      MASTER_KEY: mymasterkey
      APP_ID: myappid
      DATABASE_URI: mongodb://yourusername:yourpassword@mongodb:27017/noodlapp?authSource=admin
      PUBLIC_SERVER_URL: http://localhost:3000
    ports:
      - "3000:3000"
    links:
      - mongodb

volumes:
  mongodb-data:
