Simplify Docker build workflow and update routing rules
This commit is contained in:
@@ -24,21 +24,13 @@ jobs:
|
|||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
password: ${{ secrets.TOKEN }}
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
- name: Extract metadata for web image
|
|
||||||
id: meta-web
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/web
|
|
||||||
|
|
||||||
- name: Build and push web image
|
- name: Build and push web image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./web
|
context: ./web
|
||||||
file: ./web/Dockerfile
|
file: ./web/Dockerfile
|
||||||
tags: ${{ steps.meta-web.outputs.tags }}
|
tags: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/web:${{ gitea.ref_name }}
|
||||||
labels: ${{ steps.meta-web.outputs.labels }}
|
push: true
|
||||||
cache-from: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/web:buildcache
|
|
||||||
cache-to: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/web:buildcache,mode=max
|
|
||||||
|
|
||||||
build-api:
|
build-api:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -56,18 +48,10 @@ jobs:
|
|||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
password: ${{ secrets.TOKEN }}
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
- name: Extract metadata for api image
|
|
||||||
id: meta-api
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api
|
|
||||||
|
|
||||||
- name: Build and push api image
|
- name: Build and push api image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./api
|
context: ./api
|
||||||
file: ./api/Dockerfile
|
file: ./api/Dockerfile
|
||||||
tags: ${{ steps.meta-api.outputs.tags }}
|
tags: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:${{ gitea.ref_name }}
|
||||||
labels: ${{ steps.meta-api.outputs.labels }}
|
push: true
|
||||||
cache-from: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache
|
|
||||||
cache-to: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache,mode=max
|
|
||||||
|
|||||||
11
adc.yaml
11
adc.yaml
@@ -17,7 +17,7 @@ services:
|
|||||||
vars:
|
vars:
|
||||||
- - uri
|
- - uri
|
||||||
- "~~"
|
- "~~"
|
||||||
- "^(?!/api|/docs)"
|
- "^(?!/api)"
|
||||||
priority: 1
|
priority: 1
|
||||||
plugins:
|
plugins:
|
||||||
redirect:
|
redirect:
|
||||||
@@ -35,15 +35,6 @@ services:
|
|||||||
port: 80
|
port: 80
|
||||||
weight: 100
|
weight: 100
|
||||||
routes:
|
routes:
|
||||||
- name: nginx-api-docs-route
|
|
||||||
uris:
|
|
||||||
- /docs
|
|
||||||
- /docs/*
|
|
||||||
priority: 30
|
|
||||||
plugins:
|
|
||||||
redirect:
|
|
||||||
http_to_https: true
|
|
||||||
|
|
||||||
- name: nginx-api-llm-route
|
- name: nginx-api-llm-route
|
||||||
uris:
|
uris:
|
||||||
- /api/llm
|
- /api/llm
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ WORKDIR /app
|
|||||||
RUN pip install --no-cache-dir fastapi uvicorn[standard] pydantic
|
RUN pip install --no-cache-dir fastapi uvicorn[standard] pydantic
|
||||||
|
|
||||||
# Copy application
|
# Copy application
|
||||||
|
COPY db.json .
|
||||||
COPY main.py .
|
COPY main.py .
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ data:
|
|||||||
vars:
|
vars:
|
||||||
- - uri
|
- - uri
|
||||||
- "~~"
|
- "~~"
|
||||||
- "^(?!/api|/docs)"
|
- "^(?!/api)"
|
||||||
priority: 1
|
priority: 1
|
||||||
plugins:
|
plugins:
|
||||||
{{- if .Values.api7.tls.enabled }}
|
{{- if .Values.api7.tls.enabled }}
|
||||||
@@ -47,17 +47,6 @@ data:
|
|||||||
port: 80
|
port: 80
|
||||||
weight: 100
|
weight: 100
|
||||||
routes:
|
routes:
|
||||||
- name: nginx-api-docs-route
|
|
||||||
uris:
|
|
||||||
- /docs
|
|
||||||
- /docs/*
|
|
||||||
priority: 30
|
|
||||||
plugins:
|
|
||||||
{{- if .Values.api7.tls.enabled }}
|
|
||||||
redirect:
|
|
||||||
http_to_https: true
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
- name: nginx-api-llm-route
|
- name: nginx-api-llm-route
|
||||||
uris:
|
uris:
|
||||||
- /api/llm
|
- /api/llm
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
# Copy application and documentation
|
# Copy application and documentation
|
||||||
COPY main.py .
|
COPY main.py .
|
||||||
COPY docs/ ./docs/
|
COPY docs/ ./docs/
|
||||||
|
COPY static/ ./static/
|
||||||
COPY mkdocs.yml .
|
COPY mkdocs.yml .
|
||||||
|
|
||||||
# Build documentation during image build
|
# Build documentation during image build
|
||||||
|
|||||||
Reference in New Issue
Block a user