Skip to content

Commit

Permalink
Merge pull request #37 from rodekruis/dev
Browse files Browse the repository at this point in the history
switch to poetry and update everything
  • Loading branch information
jmargutt authored Aug 15, 2024
2 parents 8ffabd6 + 754047d commit 69584ab
Show file tree
Hide file tree
Showing 6 changed files with 2,092 additions and 35 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: build and deploy to dev

on:
push:
branches:
- dev
workflow_dispatch:

jobs:
build:
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: ./app

steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to registry
uses: docker/login-action@v1
with:
registry: https://510emergencies.azurecr.io/
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and push container image to container registry
uses: docker/build-push-action@v2
with:
push: true
tags: 510emergencies.azurecr.io/kobo-connect-dev:${{ github.sha }}
file: Dockerfile

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'dev'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Deploy container image to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'kobo-connect'
slot-name: 'dev'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DEV }}
images: '510emergencies.azurecr.io/kobo-connect-dev:${{ github.sha }}'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: build and deploy to Azure Web App
name: build and deploy to prod

on:
push:
Expand All @@ -14,7 +14,7 @@ jobs:
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: ./summarizer-api
working-directory: ./app

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# python base image in the container from Docker Hub
FROM python:3.9-slim
FROM python:3.11-slim

# copy files to the /app folder in the container
ADD clients /app/clients
ADD mappings /app/mappings
COPY ./main.py /app/main.py
COPY ./requirements.txt /app/requirements.txt
COPY ./pyproject.toml /app/pyproject.toml
COPY ./poetry.lock /app/poetry.lock

# set the working directory in the container to be /app
WORKDIR /app

# install required packages
RUN pip install -r requirements.txt
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-root

# expose the port that uvicorn will run the app on
ENV PORT=8000
Expand Down
Loading

0 comments on commit 69584ab

Please sign in to comment.