Skip to content

Commit

Permalink
stack is working (#161)
Browse files Browse the repository at this point in the history
* stack is working

* working dockerfile cleaned up
  • Loading branch information
claymccullough authored Jul 11, 2024
1 parent ce20e48 commit 06bb60e
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 33 deletions.
120 changes: 120 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
services:
# stack:
# build:
# context: ./stack
# dockerfile: Dockerfile
# container_name: PersonaStack
# # restart: on-failure
# ports:
# - "9000:9000"
# networks:
# - net
# env_file:
# - .env.production
postgres-db:
# Use a custom Docker build context for PostgreSQL.
build: ./contrib/postgresql
container_name: postgres-db
restart: on-failure
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- postgresql_data:/var/lib/postgresql/data
networks:
- net
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:latest
restart: always
container_name: qdrant
ports:
- 6333:6333
- 6334:6334
expose:
- 6333
- 6334
- 6335
configs:
- source: qdrant_config
target: ./contrib/qdrant/config/config.yaml
volumes:
- ./qdrant_data:/qdrant_data
networks:
- net
unstructured-api:
env_file:
- .env
image: quay.io/unstructured-io/unstructured-api:latest
container_name: unstructured-api
environment:
- UNSTRUCTURED_API_KEY=${UNSTRUCTURED_API_KEY}
ports:
- 8000:8000
networks:
- net
# langfuse-server:
# image: langfuse/langfuse:latest
# container_name: langfuse
# platform: linux/amd64
# depends_on:
# postgres-db:
# condition: service_healthy
# ports:
# - "3000:3000"
# networks:
# - net
# environment:
# - DATABASE_URL=postgresql://postgres:postgres@postgres-db:5432/langfuse
# - NEXTAUTH_SECRET=mysecret
# - SALT=mysalt
# - NEXTAUTH_URL=http://localhost:3000
# - TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
# - LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
# phoenix:
# image: arizephoenix/phoenix:latest
# container_name: phoenix
# platform: linux/amd64
# depends_on:
# postgres-db:
# condition: service_healthy
# networks:
# - net
# ports:
# - 6006:6006 # PHOENIX_PORT
# - 4317:4317 # PHOENIX_GRPC_PORT
# - 9090:9090 # [Optional] PROMETHEUS PORT IF ENABLED
# environment:
# - PHOENIX_SQL_DATABASE_URL=postgresql://postgres:postgres@postgres-db:5432/phoenix
# - PHOENIX_WORKING_DIR=/phoenix
# Uncomment if you want to run local models using ollama docker image
# ollama:
# image: ollama/ollama
# container_name: embed-ollama
# ports:
# - 11435:11434
# volumes:
# - ./models:/root/.ollama/models

configs:
qdrant_config:
content: |
log_level: INFO
networks:
net:
volumes:
qdrant_data:
driver: local
postgresql_data:
driver: local
langfuse_data:
driver: local
# models:
# driver: local
22 changes: 10 additions & 12 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
services:
# stack:
# build:
# context: ./stack
# dockerfile: Dockerfile
# container_name: PersonaStack
# # restart: on-failure
# ports:
# - "9000:9000"
# networks:
# - net
# env_file:
# - .env.production
stack:
image: personaflow/stack:latest
container_name: stack
# restart: on-failure
ports:
- "9000:9000"
networks:
- net
env_file:
- .env.production
postgres-db:
# Use a custom Docker build context for PostgreSQL.
build: ./contrib/postgresql
Expand Down
3 changes: 3 additions & 0 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ resolves = { python-default = "constraints.txt"}
# problematic system Pythons. See
# https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path.
search_path = ["<PATH>", "<PYENV>"]

[docker]
build_verbose = true
2 changes: 2 additions & 0 deletions stack/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pex_binary(

docker_image(
name="docker",
dependencies=[":local"],
repository="personaflow/stack"
)

shell_sources()
24 changes: 3 additions & 21 deletions stack/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,8 @@ ENV ENVIRONMENT='' \
AZURE_OPENAI_DEPLOYMENT_NAME='' \
AZURE_OPENAI_API_BASE='' \
AZURE_OPENAI_API_KEY='' \
AZURE_OPENAI_API_VERSION='' \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
RUN apt-get update && apt-get upgrade && apt-get clean && apt-get install -y libmagic1
AZURE_OPENAI_API_VERSION=''

FROM base as builder
WORKDIR /app
COPY stack/local.pex /bin/app


COPY pyproject.toml poetry.lock /app/
RUN pip install --upgrade pip \
&& pip install poetry \
&& poetry config virtualenvs.in-project true \
&& poetry install --without dev --no-root

FROM base as runner
WORKDIR /app
COPY --from=builder /app /app
COPY . /app
EXPOSE 9000
CMD ["/app/.venv/bin/uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "9000"]
ENTRYPOINT ["/usr/local/bin/python3.11", "/bin/app"]

0 comments on commit 06bb60e

Please sign in to comment.