-
Notifications
You must be signed in to change notification settings - Fork 16
Dockerize #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dockerize #2
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
48c0ab6
add docker compose
lohanidamodar b74e28e
Merge remote-tracking branch 'origin/main' into feat-dockerize
lohanidamodar 859a193
Support secret
lohanidamodar 1b31c0b
fix version name
lohanidamodar f78a976
release action
lohanidamodar 70e8270
remove traefik labels
lohanidamodar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,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 | ||
| tags: | | ||
| type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{major}} | ||
|
Comment on lines
+41
to
+42
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| - 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 }} | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -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" ] |
This file contains hidden or 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 |
|---|---|---|
| @@ -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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "ai-api", | ||
| "version": "1.0.0", | ||
| "version": "0.1.0", | ||
| "description": "", | ||
| "main": "main.js", | ||
| "scripts": { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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