mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-16 14:57:20 +00:00
docker compose commands
This commit is contained in:
parent
bd0622ef10
commit
8cd7e406c0
9 changed files with 129 additions and 0 deletions
18
docker/pgvector/compose.yaml
Normal file
18
docker/pgvector/compose.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
services:
|
||||
postgres:
|
||||
build:
|
||||
context: ./postgres
|
||||
dockerfile: postgres.Dockerfile
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres/vector_extension.sql:/docker-entrypoint-initdb.d/0-vector_extension.sql
|
||||
# - ./postgres/0-vector-extension.sh:/docker-entrypoint-initdb.d/0-vector-extension.sh
|
||||
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_DB=vectorexample
|
||||
volumes:
|
||||
postgres_data:
|
14
docker/pgvector/postgres/0-vector-extension.sh
Executable file
14
docker/pgvector/postgres/0-vector-extension.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
set -e
|
||||
|
||||
echo "In create extension"
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="$POSTGRES_DB" <<EOFSQL
|
||||
CREATE EXTENSION vector;
|
||||
EOFSQL
|
2
docker/pgvector/postgres/init.sql
Normal file
2
docker/pgvector/postgres/init.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- Create the 'store' database
|
||||
CREATE DATABASE store;
|
15
docker/pgvector/postgres/postgres.Dockerfile
Normal file
15
docker/pgvector/postgres/postgres.Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
|||
# This is installing the pgvector extension for postgres
|
||||
FROM postgres:latest
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
git \
|
||||
postgresql-server-dev-all \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /tmp
|
||||
RUN git clone https://github.com/pgvector/pgvector.git
|
||||
|
||||
WORKDIR /tmp/pgvector
|
||||
RUN make
|
||||
RUN make install
|
2
docker/pgvector/postgres/vector_extension.sql
Normal file
2
docker/pgvector/postgres/vector_extension.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- Create the 'vector' extension within the database that is set in the docker-compose.yml
|
||||
CREATE EXTENSION IF NOT EXISTS vector;
|
Loading…
Add table
Add a link
Reference in a new issue