Skip to content

Commit

Permalink
Merge pull request #122 from kneelesh48/docker-updates
Browse files Browse the repository at this point in the history
Docker updates
  • Loading branch information
vanpelt committed May 20, 2024
2 parents 1f83438 + a64b068 commit 769579a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
19 changes: 14 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# Build the virtualenv as a separate step: Only re-execute this step when pyproject.toml changes
FROM python:3.12-bookworm AS build-venv
COPY pyproject.toml /build/pyproject.toml
RUN python -m venv /venv && \

WORKDIR /build
COPY pyproject.toml .
COPY README.md .

RUN mkdir -p openui/util && \
python -m venv /venv && \
/venv/bin/pip install --upgrade pip setuptools wheel && \
mkdir -p /build/openui/util && touch /build/README.md
RUN /venv/bin/pip install --disable-pip-version-check /build
/venv/bin/pip install --disable-pip-version-check .

# Copy the virtualenv into a distroless image
FROM python:3.12-slim-bookworm

ENV PATH="/venv/bin:$PATH"

COPY --from=build-venv /venv /venv
COPY . /app

WORKDIR /app

RUN pip install --no-deps -U /app
ENTRYPOINT ["python", "-m", "openui"]

ENTRYPOINT ["python", "-m", "openui"]
4 changes: 2 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dependencies = [
"uvicorn>=0.25.0",
"fastapi-sso>=0.13.0",
"boto3>=1.34.67",
"Pillow>=8.3.1",
"playwright>=1.41.0",
]
name = "openui"
version = "0.3.1"
Expand Down Expand Up @@ -36,8 +38,6 @@ CI = "https://github.com/wandb/openui/actions"
[project.optional-dependencies]
test = ["pytest", "pre-commit"]
eval = [
"Pillow>=8.3.1",
"playwright>=1.41.0",
"beautifulsoup4>=4.0.0",
"mistletoe>=1.0.0",
]
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ version: '3.8'

services:
ollama:
container_name: ollama
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ${OLLAMA_VOLUME_PATH:-ollama}:/root/.ollama

backend:
container_name: openui
build:
context: ./backend
dockerfile: Dockerfile
Expand All @@ -18,7 +20,9 @@ services:
- OLLAMA_HOST=http://ollama:11434
# Just remove `=xxx` to have the env variable passed forward
- OPENAI_API_KEY=xxx
- GROQ_API_KEY=xxx
depends_on:
- ollama

volumes:
ollama:
ollama:

0 comments on commit 769579a

Please sign in to comment.