azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Deploying to VM

Open Izzatullohh opened this issue 1 year ago • 3 comments

I want to deploy this app to my VM using Nginx. is there any instruction on this?

Thank you:)

Izzatullohh avatar Apr 09 '24 07:04 Izzatullohh

Sorry, we don't have any particular instruction for that. If it's helper, this is a Dockerfile for running the app:

FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye

RUN python -m pip install --upgrade pip

WORKDIR /demo-code

COPY requirements.txt .
RUN python -m pip install -r requirements.txt
RUN python -m pip install gunicorn==21.2.0

COPY entrypoint.sh .
RUN chmod +x entrypoint.sh

COPY . .
CMD bash -c ". entrypoint.sh"

where entrypoint.sh is:

python3 -m gunicorn main:app

pamelafox avatar Apr 11 '24 12:04 pamelafox

The Bicep files in the infra folder set up a ton of resources and RBAC roles, so you would want to start with provisioning that Bicep, and then see how you can swap out App Service with a VM. You'd need to make a managed identity for that VM and assign it all the roles we currently assign to the app service, and also make sure to set all the environment variables we set on the App Service app.

pamelafox avatar Apr 11 '24 12:04 pamelafox

Thank you for the help, Pamela. I appreciate it :)

Izzatullohh avatar Apr 12 '24 07:04 Izzatullohh