Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/deploy.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Release"

on:
release:
types: [published]

jobs:
tests:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Fetch submodules
submodules: recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: appwrite/appwrite
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lohanidamodar this image name needs to be updated to appwrite/assistant

tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
Comment on lines +41 to +42
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we don't need all the versions for the image like we do with appwrite.
Just the first combination of major.minor.patch is sufficient


- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM python:3.9
FROM node:18

WORKDIR /app
WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY package.json ./
COPY pnpm-lock.yaml ./

RUN npm install -g pnpm

RUN pnpm --prod install

COPY . .

CMD [ "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80" ]
ENV OPENAI_API_KEY='' \
ASSISTANT_SECRET=''

EXPOSE 3003
CMD [ "node", "main.js" ]
34 changes: 3 additions & 31 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
version: '3.8'

services:
traefik:
image: traefik:v2.10
command:
- --log.level=DEBUG
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --accesslog=true
ports:
- 80:80
- 8080:8080
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- gateway

assistant:
build: .
networks:
- gateway
labels:
- "traefik.enable=true"
- "traefik.http.services.assistant-service.loadbalancer.server.port=80"
# http
- "traefik.http.routers.assistant.entrypoints=web"
- "traefik.http.routers.assistant.rule=PathPrefix(`/`)"
- "traefik.http.routers.assistant.service=assistant-service"
ports:
- 3003:3003
volumes:
- ./docs:/app/docs
environment:
- OPENAI_API_KEY

networks:
gateway:
driver: bridge
- ASSISTANT_SECRET
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ai-api",
"version": "1.0.0",
"version": "0.1.0",
"description": "",
"main": "main.js",
"scripts": {
Expand Down