version: "3.5"

# see ./azure-deploy.sh for notes on how to run

services:

    sqlite3:
      # hmm... runs, but not access; SQLAlchemy syntax for sqlite service?  (it's just files below)
      image: nouchka/sqlite3:latest
      stdin_open: true
      tty: true
      volumes:
        - ${WEBAPP_STORAGE_HOME}/../../database/:/root/db/
      # thanks (?): https://stackoverflow.com/questions/65811608/how-to-connect-flask-app-to-sqlite-db-running-in-docker
      # https://learn.microsoft.com/en-us/azure/developer/python/tutorial-containerize-simple-web-app?tabs=web-app-flask

    api-logic-server:
        image: apilogicserver/apilogicserver_project_name_lower
        environment:
          - APILOGICPROJECT_VERBOSE=true
          - SECURITY_ENABLED=true
          - APILOGICPROJECT_CLIENT_URI=//apilogicserver_project_name_lower.azurewebsites.net
          # - APILOGICPROJECT_HTTP_SCHEME=https
          - PYTHONPATH=/app/ApiLogicProject 
          ## todid - use default database uri's:
          # - APILOGICPROJECT_SQLALCHEMY_DATABASE_URI=sqlite:////my/sqlite/path/db.sqlite
          # - APILOGICPROJECT_SQLALCHEMY_DATABASE_URI_AUTHENTICATION=sqlite:////my/sqlite/path/authentication_db.sqlite

        expose:
           - 5656
        ports:
            - 5656:5656
        volumes:
            - ${WEBAPP_STORAGE_HOME}/apilogicserver_project_name_lower:/app
            - ${WEBAPP_STORAGE_HOME}/home/api_logic_project/database/:/my/sqlite/path/
        # container should start automatically - command:  api_logic_server_run.py
        working_dir: /home/api_logic_project
