diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d5046b63f0..a164f45e9a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,11 +1,9 @@ name: Docker Image CI on: - workflow_dispatch: - inputs: - branch: - description: 'The branch to build' - required: true + push: + branches: + - main jobs: @@ -18,19 +16,17 @@ jobs: uses: Azure/docker-login@v1 with: # Container registry username - username: ${{ secrets.ACR_USERNAME }} + username: ${{ secrets.SAMPLEAPP_ACR_USERNAME }} # Container registry password - password: ${{ secrets.ACR_PASSWORD }} + password: ${{ secrets.SAMPLEAPP_ACR_PASSWORD }} # Container registry server url - login-server: ${{ secrets.ACR_LOGIN_SERVER }} + login-server: sampleappaoaichatgpt.azurecr.io - uses: actions/checkout@v3 - with: - ref: ${{ github.event.inputs.branch }} - name: Build the Docker image run: - docker build . --file WebApp.Dockerfile --tag fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; - docker tag fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:latest; - docker push fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; - docker push fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:latest; + docker build . --file WebApp.Dockerfile --tag sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; + docker tag sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:latest; + docker push sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; + docker push sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:latest; diff --git a/WebApp.Dockerfile b/WebApp.Dockerfile index d53ef54cfc..af27b28807 100644 --- a/WebApp.Dockerfile +++ b/WebApp.Dockerfile @@ -17,8 +17,7 @@ RUN apk add --no-cache --virtual .build-deps \ openssl-dev \ curl \ && apk add --no-cache \ - libpq \ - && pip install --no-cache-dir uwsgi + libpq COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \ @@ -27,6 +26,6 @@ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \ COPY . /usr/src/app/ COPY --from=frontend /home/node/app/static /usr/src/app/static/ WORKDIR /usr/src/app - EXPOSE 80 -CMD ["python", "-m", "gunicorn", "app:app"] \ No newline at end of file + +CMD ["gunicorn" , "-b", "0.0.0.0:80", "app:app"] \ No newline at end of file diff --git a/infrastructure/deployment.json b/infrastructure/deployment.json index 9957321287..dfc540005a 100644 --- a/infrastructure/deployment.json +++ b/infrastructure/deployment.json @@ -190,7 +190,7 @@ }, "AzureOpenAIApiVersion": { "type": "string", - "defaultValue": "2023-06-01-preview", + "defaultValue": "2023-12-01-preview", "metadata": { "description": "Azure OpenAI Api Version" } @@ -358,7 +358,7 @@ } }, "variables": { - "WebAppImageName": "DOCKER|fruoccopublic.azurecr.io/sample-app-aoai-chatgpt:latest", + "WebAppImageName": "DOCKER|sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:latest", "cosmosdb_account_name": "[format('db-{0}', parameters('WebsiteName'))]", "cosmosdb_database_name": "db_conversation_history", "cosmosdb_container_name": "conversations", diff --git a/requirements.txt b/requirements.txt index 5c8abef1a1..047642ce2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ python-dotenv==1.0.0 azure-cosmos==4.5.0 quart==0.19.4 uvicorn==0.24.0 -aiohttp==3.9.2 \ No newline at end of file +aiohttp==3.9.2 +gunicorn==20.1.0