diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..9a72328 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Twilio credentials (replace these with your actual credentials) +TWILIO_ACCOUNT_SID = "your_account_sid_here" +TWILIO_AUTH_TOKEN = "your_auth_token_here" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b6135c9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish container image +on: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-backend: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Log in to the container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: backend + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + file: backend/Containerfile diff --git a/.gitignore b/.gitignore index 1d17dae..8d19362 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .venv +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d637a42 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.11-slim + +# Create and set the working directory +WORKDIR /app + +# Copy the requirements file into the container +COPY requirements.txt . + +# Install the Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 8000 + +CMD ["python", "./server.py"] + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7851584 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +fastapi +faster-whisper +python-dotenv +python-multipart +requests +twilio +uvicorn