-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from LlmLaraHub/docker-sail
- Loading branch information
Showing
6 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
services: | ||
laravel.test: | ||
build: | ||
context: ./vendor/laravel/sail/runtimes/8.3 | ||
dockerfile: Dockerfile | ||
args: | ||
WWWGROUP: "${WWWGROUP}" | ||
image: sail-8.3/app | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
ports: | ||
- "${APP_PORT:-80}:80" | ||
- "${VITE_PORT:-5173}:${VITE_PORT:-5173}" | ||
- "${REVERB_SERVER_PORT:-8080}:8080" | ||
environment: | ||
WWWUSER: "${WWWUSER}" | ||
LARAVEL_SAIL: 1 | ||
XDEBUG_MODE: "${SAIL_XDEBUG_MODE:-off}" | ||
XDEBUG_CONFIG: "${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}" | ||
IGNITION_LOCAL_SITES_PATH: "${PWD}" | ||
volumes: | ||
- ".:/var/www/html" | ||
networks: | ||
- sail | ||
depends_on: | ||
- pgsql | ||
- redis | ||
pgsql: | ||
build: ./docker/psql | ||
ports: | ||
- "${FORWARD_DB_PORT:-5432}:5432" | ||
environment: | ||
PGPASSWORD: "${DB_PASSWORD:-secret}" | ||
POSTGRES_DB: "${DB_DATABASE}" | ||
POSTGRES_USER: "${DB_USERNAME}" | ||
POSTGRES_PASSWORD: "${DB_PASSWORD:-secret}" | ||
volumes: | ||
- "sail-pgsql:/var/lib/postgresql/data" | ||
- "./vendor/laravel/sail/database/pgsql/create-testing-database.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql" | ||
networks: | ||
- sail | ||
healthcheck: | ||
test: | ||
- CMD | ||
- pg_isready | ||
- "-q" | ||
- "-d" | ||
- "${DB_DATABASE}" | ||
- "-U" | ||
- "${DB_USERNAME}" | ||
retries: 3 | ||
timeout: 5s | ||
redis: | ||
image: "redis:alpine" | ||
ports: | ||
- "${FORWARD_REDIS_PORT:-6379}:6379" | ||
volumes: | ||
- "sail-redis:/data" | ||
networks: | ||
- sail | ||
healthcheck: | ||
test: | ||
- CMD | ||
- redis-cli | ||
- ping | ||
retries: 3 | ||
timeout: 5s | ||
ollama: | ||
build: ./docker/ollama | ||
container_name: larallama-ollama | ||
ports: | ||
- "11434:11434" | ||
healthcheck: | ||
test: ollama --version || exit 1 | ||
volumes: | ||
- sail-ollama:/root/.ollama | ||
networks: | ||
- sail | ||
entrypoint: ["/usr/bin/bash", "/pull-llama3.sh"] | ||
networks: | ||
sail: | ||
driver: bridge | ||
volumes: | ||
sail-pgsql: | ||
driver: local | ||
sail-redis: | ||
driver: local | ||
sail-ollama: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ollama/ollama:latest | ||
|
||
COPY ./pull-llama3.sh /pull-llama3.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
/bin/ollama serve & | ||
# Record Process ID. | ||
pid=$! | ||
|
||
# Pause for Ollama to start. | ||
sleep 5 | ||
|
||
echo "🔴==================== Retrieve LLAMA3 model" | ||
ollama pull llama3 | ||
echo "🟢==================== LLAMA3 model pulled" | ||
|
||
echo "🔴==================== Retrieve embedding model" | ||
ollama pull mxbai-embed-large | ||
echo "🟢==================== embedding model pulled" | ||
|
||
# Wait for Ollama process to finish. | ||
wait $pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM postgres:15 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
postgresql-15-pgvector \ | ||
postgresql-15-postgis \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /docker-entrypoint-initdb.d | ||
COPY ./extensions.sh /docker-entrypoint-initdb.d/10_postgis.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Perform all actions as $POSTGRES_USER | ||
export PGUSER="$POSTGRES_USER" | ||
|
||
# Create the 'template_postgis' template db | ||
"${psql[@]}" <<- 'EOSQL' | ||
CREATE DATABASE template_postgis IS_TEMPLATE true; | ||
EOSQL | ||
|
||
# Load PostGIS into both template_database and $POSTGRES_DB | ||
for DB in template_postgis "$POSTGRES_DB"; do | ||
echo "Loading PostGIS extensions into $DB" | ||
"${psql[@]}" --dbname="$DB" <<-'EOSQL' | ||
CREATE EXTENSION IF NOT EXISTS postgis; | ||
CREATE EXTENSION IF NOT EXISTS vector; | ||
EOSQL | ||
done |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.