Skip to content

Commit

Permalink
Update docker image for async refactor, use new ACR (microsoft#625)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Seabock (Centific Technologies Inc) <[email protected]>
  • Loading branch information
sarah-widder and Ian Seabock (Centific Technologies Inc) authored Feb 17, 2024
1 parent 8c4ab56 commit 31dbce2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Docker Image CI

on:
workflow_dispatch:
inputs:
branch:
description: 'The branch to build'
required: true
push:
branches:
- main

jobs:

Expand All @@ -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;

7 changes: 3 additions & 4 deletions WebApp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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"]

CMD ["gunicorn" , "-b", "0.0.0.0:80", "app:app"]
4 changes: 2 additions & 2 deletions infrastructure/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
},
"AzureOpenAIApiVersion": {
"type": "string",
"defaultValue": "2023-06-01-preview",
"defaultValue": "2023-12-01-preview",
"metadata": {
"description": "Azure OpenAI Api Version"
}
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
aiohttp==3.9.2
gunicorn==20.1.0

0 comments on commit 31dbce2

Please sign in to comment.