version: "3.8" services: frontend: build: context: ./frontend args: - REACT_APP_OAUTH_CLIENT_ID=${OPENDC_OAUTH_CLIENT_ID} image: frontend restart: on-failure ports: - "8081:80" networks: - backend api: build: ./api image: api restart: on-failure # Comment out these 2 lines for deployment ports: - "8081:8081" networks: - backend depends_on: - mongo environment: - MONGO_INITDB_ROOT_USERNAME - MONGO_INITDB_ROOT_PASSWORD - MONGO_INITDB_DATABASE - OPENDC_DB - OPENDC_DB_USERNAME - OPENDC_DB_PASSWORD - OPENDC_DB_HOST=mongo - OPENDC_FLASK_SECRET - OPENDC_OAUTH_CLIENT_ID - OPENDC_ROOT_DIR - OPENDC_SERVER_BASE_URL simulator: build: ./simulator image: simulator restart: on-failure networks: - backend depends_on: - mongo volumes: - type: bind source: ./traces target: /home/gradle/simulator/traces - type: volume source: results-volume target: /results # Override to root as the simulator won't be able to access the volume otherwise user: root environment: - OPENDC_DB - OPENDC_DB_USERNAME - OPENDC_DB_PASSWORD - OPENDC_DB_HOST=mongo - OPENDC_OUTPUT=/results mongo: build: context: database restart: on-failure environment: - MONGO_INITDB_ROOT_USERNAME - MONGO_INITDB_ROOT_PASSWORD - MONGO_INITDB_DATABASE - OPENDC_DB - OPENDC_DB_USERNAME - OPENDC_DB_PASSWORD networks: - backend # Comment out for public deployment ports: - "27017:27017" # Uncomment for persistent deployment volumes: - mongo-volume:/data/db mongo-express: image: mongo-express restart: on-failure networks: - backend depends_on: - mongo ports: - 8082:8081 environment: ME_CONFIG_MONGODB_ADMINUSERNAME: "${MONGO_INITDB_ROOT_USERNAME}" ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGO_INITDB_ROOT_PASSWORD}" volumes: mongo-volume: external: false results-volume: networks: backend: {}