Saving changes. Just going to stick with one docker service for storage
soaricarus_api CI / Rustfmt (pull_request) Successful in 5m54s
soaricarus_api CI / Check (pull_request) Successful in 6m4s
soaricarus_api CI / Test Suite (pull_request) Successful in 7m40s
soaricarus_api CI / build (pull_request) Successful in 3m18s
soaricarus_api CI / Clippy (pull_request) Successful in 4m41s
soaricarus_api CI / Rustfmt (pull_request) Successful in 5m54s
soaricarus_api CI / Check (pull_request) Successful in 6m4s
soaricarus_api CI / Test Suite (pull_request) Successful in 7m40s
soaricarus_api CI / build (pull_request) Successful in 3m18s
soaricarus_api CI / Clippy (pull_request) Successful in 4m41s
This commit is contained in:
+56
-62
@@ -60,73 +60,67 @@ services:
|
|||||||
# - soaricarus-network
|
# - soaricarus-network
|
||||||
|
|
||||||
# --- storage service ---
|
# --- storage service ---
|
||||||
maze:
|
garage:
|
||||||
build:
|
image: dxflrs/garage:v2.3.0 # Use official Garage image
|
||||||
context: ./garage/storage
|
container_name: garage
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: maze
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
# Garage configuration via environment variables
|
||||||
|
GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900"
|
||||||
|
GARAGE_SERVER_BIND_PUBLIC_ADDR: "0.0.0.0:3901"
|
||||||
|
GARAGE_S3_API_S3_REGION: "garage"
|
||||||
|
GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900"
|
||||||
|
GARAGE_S3_API_PUBLIC_BIND_ADDR: "0.0.0.0:3901"
|
||||||
|
GARAGE_S3_API_PUBLIC_ADDRS: "http://localhost:3901"
|
||||||
|
GARAGE_S3_API_ROOT_DOMAIN: "garage.local"
|
||||||
|
GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902"
|
||||||
|
GARAGE_ADMIN_PUBLIC_BIND_ADDR: "0.0.0.0:3902"
|
||||||
|
|
||||||
|
# Cluster configuration (single node for simplicity)
|
||||||
|
GARAGE_CLUSTER_REPLICATION_MODE: "none" # Single node
|
||||||
|
GARAGE_CLUSTER_PEER_REPLICATION_STRATEGY: "ring"
|
||||||
|
|
||||||
|
# Data storage
|
||||||
|
GARAGE_DATA_DIR: "/data"
|
||||||
|
GARAGE_METADATA_DIR: "/data/meta"
|
||||||
|
|
||||||
|
# RPC configuration
|
||||||
|
GARAGE_RPC_PUBLIC_ADDR: "http://garage:3901"
|
||||||
|
GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901"
|
||||||
|
GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET:-changeme12345678901234567890123456789012}" # 32+ chars
|
||||||
|
|
||||||
|
# Web Admin
|
||||||
|
GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN:-garage-admin-token}"
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
GARAGE_LOG_LEVEL: "info"
|
||||||
|
|
||||||
|
GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}:-soaricarus-storage"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# - garage_data:/data # Persist Garage data
|
||||||
|
- ./garage.toml:/etc/garage.toml:ro # Mount config file
|
||||||
|
- shared_credentials:/data # Persist Garage data
|
||||||
ports:
|
ports:
|
||||||
- "3900:3900" # S3 API
|
- "3900:3900" # S3 API
|
||||||
- "3901:3901" # RPC for cluster communication
|
- "3901:3901" # S3 API public
|
||||||
- "3902:3902" # S3 web interface
|
- "3902:3902" # Admin API
|
||||||
- "3903:3903" # Admin API
|
# entrypoint: ["/bin/bash", "-c"]
|
||||||
volumes:
|
# command:
|
||||||
- ./garage.toml:/etc/garage.toml:ro
|
# - |
|
||||||
# - ./garage/entrypoint.sh:/entrypoint.sh:ro
|
# ls /
|
||||||
- ./garage/storage/run.sh:/run.sh:ro
|
# /garage -c /etc/garage.toml server
|
||||||
- shared_credentials:/shared
|
command: ["/garage", "-c", "/etc/garage.toml", "server"]
|
||||||
- object_data:/var/lib/garage
|
healthcheck:
|
||||||
# - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory
|
test: ["CMD", "curl", "-f", "http://localhost:3900/"]
|
||||||
env_file:
|
interval: 30s
|
||||||
- .env
|
timeout: 10s
|
||||||
environment:
|
retries: 3
|
||||||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
start_period: 10s
|
||||||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
||||||
- GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET}
|
|
||||||
- BUCKET_NAME=${S3_BUCKET_NAME}
|
|
||||||
# entrypoint: ["/entrypoint.sh"]
|
|
||||||
# command: []
|
|
||||||
# healthcheck:
|
|
||||||
# test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"]
|
|
||||||
# test: ["CMD-SHELL", "echo 'What is to be done?'"]
|
|
||||||
# test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"]
|
|
||||||
# test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"]
|
|
||||||
# interval: 10s
|
|
||||||
# timeout: 5s
|
|
||||||
# retries: 5
|
|
||||||
# start_period: 30s
|
|
||||||
networks:
|
|
||||||
- soaricarus-network
|
|
||||||
|
|
||||||
maze-init:
|
|
||||||
# image: dxflrs/garage:v2.3.0
|
|
||||||
# image: docker:dind
|
|
||||||
build:
|
|
||||||
context: ./garage/init
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: maze-init
|
|
||||||
depends_on:
|
|
||||||
maze:
|
|
||||||
condition: service_started
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket
|
|
||||||
- shared_credentials:/shared
|
|
||||||
- object_data:/var/lib/garage
|
|
||||||
- ./garage/init/entrypoint.sh:/entrypoint.sh:ro
|
|
||||||
# - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory
|
|
||||||
environment:
|
|
||||||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
|
||||||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
||||||
- GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET}
|
|
||||||
- BUCKET_NAME=${S3_BUCKET_NAME}
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
# entrypoint: ["/bin/sh"]
|
|
||||||
# command: ["/scripts/init-garage.sh"]
|
|
||||||
restart: "no" # Run once and exit
|
|
||||||
networks:
|
networks:
|
||||||
- soaricarus-network
|
- soaricarus-network
|
||||||
|
extra_hosts:
|
||||||
|
- "garage.local:127.0.0.1" # Needed for local domain resolution
|
||||||
|
|
||||||
# PostgreSQL Database Service
|
# PostgreSQL Database Service
|
||||||
main_db:
|
main_db:
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Wait for Garage to be ready
|
||||||
|
echo "Waiting for Garage to be ready..."
|
||||||
|
until curl -s http://localhost:3902/health; do
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
# Set up the bucket
|
||||||
|
echo "Creating bucket..."
|
||||||
|
docker exec garage garage bucket create soaricarus-data
|
||||||
|
|
||||||
|
# Set bucket permissions
|
||||||
|
echo "Setting bucket permissions..."
|
||||||
|
docker exec garage garage bucket allow soaricarus-data --read --write --owner
|
||||||
|
|
||||||
|
echo "Garage setup complete!"
|
||||||
@@ -3,6 +3,11 @@ set -e
|
|||||||
|
|
||||||
BUCKET_NAME="soaricarus-storage"
|
BUCKET_NAME="soaricarus-storage"
|
||||||
|
|
||||||
|
sleep 15
|
||||||
|
echo $GARAGE_RPC_SECRET
|
||||||
|
echo "Yes"
|
||||||
|
sleep 10
|
||||||
|
|
||||||
echo "⏳ Waiting for Garage to be ready..."
|
echo "⏳ Waiting for Garage to be ready..."
|
||||||
# until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do
|
# until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do
|
||||||
until docker exec maze nc -z "localhost 3900" > /dev/null 2>&1; do
|
until docker exec maze nc -z "localhost 3900" > /dev/null 2>&1; do
|
||||||
|
|||||||
Reference in New Issue
Block a user