Merged background and api-server images

This commit is contained in:
Dan Brown
2023-07-13 23:59:22 +01:00
parent c6bcd5e1aa
commit f27364a442
5 changed files with 9 additions and 40 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