Merge pull request #173 from ssddanbrown/merge_images

Merged background and api-server images
This commit is contained in:
Yuhong Sun 2023-07-15 11:29:48 -07:00 committed by GitHub
commit 20589d8d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 42 deletions

View File

@ -39,12 +39,3 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: danswer/danswer-api-server:${{ github.ref_name }}
- name: Background Job Docker Build and Push
uses: docker/build-push-action@v2
with:
context: ./backend
file: ./backend/Dockerfile.background
platforms: linux/amd64,linux/arm64
push: true
tags: danswer/danswer-background:${{ github.ref_name }}

View File

@ -38,11 +38,3 @@ jobs:
docker push danswer/danswer-api-server:latest
docker manifest create danswer/danswer-api-server:latest danswer/danswer-api-server:latest
docker manifest push danswer/danswer-api-server:latest
- name: Pull, Tag and Push Background Job Image
run: |
docker pull danswer/danswer-background:${{ github.event.inputs.version }}
docker tag danswer/danswer-background:${{ github.event.inputs.version }} danswer/danswer-background:latest
docker push danswer/danswer-background:latest
docker manifest create danswer/danswer-background:latest danswer/danswer-background:latest
docker manifest push danswer/danswer-background:latest

View File

@ -1,17 +1,21 @@
FROM python:3.11-slim-bullseye
RUN apt-get update \
&& apt-get install -y git cmake pkg-config libprotobuf-c-dev protobuf-compiler \
libprotobuf-dev libgoogle-perftools-dev libpq-dev build-essential curl \
&& apt-get install -y git cmake pkg-config libprotobuf-c-dev protobuf-compiler \
libprotobuf-dev libgoogle-perftools-dev libpq-dev build-essential cron curl \
supervisor \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements/default.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
RUN playwright install
RUN playwright install-deps
WORKDIR /app
COPY ./danswer /app/danswer
COPY ./alembic /app/alembic
COPY ./alembic.ini /app/alembic.ini
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENV PYTHONPATH /app
CMD ["/bin/sh", "-c", "alembic upgrade head && echo \"Starting Danswer Api Server\" && uvicorn danswer.main:app --host 0.0.0.0 --port 8080"]

View File

@ -1,19 +0,0 @@
FROM python:3.11-slim-bullseye
RUN apt-get update \
&& apt-get install -y git cmake pkg-config libprotobuf-c-dev protobuf-compiler \
libprotobuf-dev libgoogle-perftools-dev libpq-dev build-essential cron curl \
supervisor \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements/default.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
RUN playwright install
RUN playwright install-deps
WORKDIR /app
COPY ./danswer /app/danswer
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENV PYTHONPATH /app
CMD ["/usr/bin/supervisord"]

View File

@ -22,10 +22,11 @@ services:
- local_dynamic_storage:/home/storage
- file_connector_tmp_storage:/home/file_connector_storage
background:
image: danswer/danswer-background:latest
image: danswer/danswer-api-server:latest
build:
context: ../../backend
dockerfile: Dockerfile.background
dockerfile: Dockerfile
command: /usr/bin/supervisord
depends_on:
- relational_db
- vector_db

View File

@ -20,10 +20,11 @@ services:
- local_dynamic_storage:/home/storage
- file_connector_tmp_storage:/home/file_connector_storage
background:
image: danswer/danswer-background:latest
image: danswer/danswer-api-server:latest
build:
context: ../../backend
dockerfile: Dockerfile.background
command: /usr/bin/supervisord
depends_on:
- relational_db
- vector_db

View File

@ -14,8 +14,9 @@ spec:
spec:
containers:
- name: background
image: danswer/danswer-background:latest
image: danswer/danswer-api-server:latest
imagePullPolicy: IfNotPresent
command: ["/usr/bin/supervisord"]
env:
- name: POSTGRES_HOST
value: relational-db-service