-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AZD can use containers instead of code for deployment (Azure-Samples#505
) * Add adminweb docker image * Build off my branch * Create Requirements. * Seperate process * Dont traverse paths * Use poetry in docker build * dont install the root app * Add frontend image * Revert docker changes * Install the root again * Use requirements rather than toml * Use Requirements for images again * Rename docker images * Frontend use app directory * Add python path * Copy the whole code folder * Frontend runs locally * Frontend and Admin working * Use containers as default hosting model * Dont build from my branch anymore * Only build docker images - after test * Change trigger workflow * Only run when tests succeed * Trigger builds only if tests pass * Only changed App Service names * Reverting
- Loading branch information
1 parent
7b659e1
commit 90cb346
Showing
16 changed files
with
5,036 additions
and
1,860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Admin Web App Docker Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Tests] | ||
types: [completed] | ||
branches: [main] | ||
|
||
jobs: | ||
docker-build-admin: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: fruoccopublic.azurecr.io | ||
username: fruoccopublic | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the Admin Docker image | ||
run: | ||
docker pull fruoccopublic.azurecr.io/rag-adminwebapp:latest || true; | ||
docker build . --file docker/Admin.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-adminwebapp:latest --tag fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker tag fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-adminwebapp:latest; | ||
docker push fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker push fruoccopublic.azurecr.io/rag-adminwebapp:latest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Backend Docker Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Tests] | ||
types: [completed] | ||
branches: [main] | ||
|
||
jobs: | ||
docker-build-backend: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: fruoccopublic.azurecr.io | ||
username: fruoccopublic | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the Backend Docker image | ||
run: | ||
docker pull fruoccopublic.azurecr.io/rag-backend:latest || true; | ||
docker build . --file docker/Backend.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-backend:latest --tag fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker tag fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-backend:latest; | ||
docker push fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker push fruoccopublic.azurecr.io/rag-backend:latest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: WebApp Docker Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Tests] | ||
types: [completed] | ||
branches: [main] | ||
|
||
jobs: | ||
docker-build-frontend: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: fruoccopublic.azurecr.io | ||
username: fruoccopublic | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the Frontend Docker image | ||
run: | ||
docker pull fruoccopublic.azurecr.io/rag-webapp:latest || true; | ||
docker build . --file docker/Frontend.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-webapp:latest --tag fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker tag fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-webapp:latest; | ||
docker push fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; | ||
docker push fruoccopublic.azurecr.io/rag-webapp:latest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:3.11.7-bookworm | ||
RUN apt-get update && apt-get install python3-tk tk-dev -y | ||
COPY pyproject.toml /usr/local/src/myscripts/pyproject.toml | ||
COPY poetry.lock /usr/local/src/myscripts/poetry.lock | ||
WORKDIR /usr/local/src/myscripts/ | ||
RUN pip install --upgrade pip && pip install poetry && poetry export -o requirements.txt && pip install -r requirements.txt | ||
COPY ./code/backend /usr/local/src/myscripts/admin | ||
COPY ./code/backend/batch/utilities /usr/local/src/myscripts/utilities | ||
WORKDIR /usr/local/src/myscripts/admin | ||
ENV PYTHONPATH "${PYTHONPATH}:/usr/local/src/myscripts/" | ||
EXPOSE 80 | ||
CMD ["streamlit", "run", "Admin.py", "--server.port", "80", "--server.enableXsrfProtection", "false"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM mcr.microsoft.com/azure-functions/python:4-python3.11 | ||
|
||
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ | ||
AzureFunctionsJobHost__Logging__Console__IsEnabled=true \ | ||
AzureWebJobsFeatureFlags=EnableWorkerIndexing | ||
|
||
COPY pyproject.toml / | ||
COPY poetry.lock / | ||
RUN pip install --upgrade pip && pip install poetry && poetry export -o requirements.txt && pip install -r requirements.txt | ||
|
||
COPY ./code/backend/batch/utilities /home/site/wwwroot/utilities | ||
COPY ./code/backend/batch /home/site/wwwroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM node:20-alpine AS frontend | ||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app | ||
WORKDIR /home/node/app | ||
COPY ./code/frontend/package*.json ./ | ||
USER node | ||
RUN npm ci | ||
COPY --chown=node:node ./code/frontend ./frontend | ||
WORKDIR /home/node/app/frontend | ||
RUN npm run build | ||
|
||
FROM python:3.11.7-bookworm | ||
RUN apt-get update && apt-get install python3-tk tk-dev -y | ||
|
||
COPY pyproject.toml /usr/src/app/pyproject.toml | ||
COPY poetry.lock /usr/src/app/poetry.lock | ||
WORKDIR /usr/src/app | ||
RUN pip install --upgrade pip && pip install poetry uwsgi && poetry export -o requirements.txt && pip install -r requirements.txt | ||
|
||
COPY ./code/ /usr/src/app | ||
COPY --from=frontend /home/node/app/static /usr/src/app/static/ | ||
ENV PYTHONPATH "${PYTHONPATH}:/usr/src/app" | ||
EXPOSE 80 | ||
CMD ["uwsgi", "--http", ":80", "--wsgi-file", "app.py", "--callable", "app", "-b","32768"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.