diff --git a/Makefile b/Makefile index c254115..808a627 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,11 @@ setup: @docker compose build @docker compose up -d +# Open the pgAdmin interface in the default browser +pgadmin: + @echo "Opening pgAdmin interface at http://localhost:5050" + @open http://localhost:5050 + # Rebuild and start the containers (force rebuild) rebuild: @docker compose build --no-cache @@ -37,6 +42,20 @@ load-db: verify-db: @docker compose exec pgduckdb psql -U postgres -d postgres -c "SELECT COUNT(*) FROM raw_claims;" +<<<<<<< Updated upstream +======= +# Information about connecting to PostgreSQL via pgAdmin +pgadmin-info: + @echo "To connect to PostgreSQL in pgAdmin:" + @echo " 1. Open http://localhost:5050 in your browser" + @echo " 2. Login with admin@sonnet.com / admin" + @echo " 3. Add a new server with these settings:" + @echo " - Name: pgduckdb" + @echo " - Host: pgduckdb" + @echo " - Port: 5432" + @echo " - Username: postgres" + @echo " - Password: postgres" +>>>>>>> Stashed changes # Check the running containers status: diff --git a/docker-compose.yml b/docker-compose.yml index 848caf5..78f5193 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,22 @@ services: + # Base containers + linuxbase: + build: ./linuxbase + container_name: linuxbase + image: linuxbase + + # Application containers (extending base containers) pythonbase: - build: - context: ./pythonbase + build: ./pythonbase container_name: pythonbase image: pythonbase depends_on: - linuxbase: - condition: service_completed_successfully + - linuxbase ports: - "4213:4213" - linuxbase: - build: - context: ./linuxbase - container_name: linuxbase - image: linuxbase - + # Database containers pgduckdb: image: pgduckdb/pgduckdb:17-v0.1.0 container_name: pgduckdb @@ -32,7 +32,26 @@ services: healthcheck: test: ["CMD", "pg_isready", "-U", "postgres"] retries: 5 + networks: + - sonnet_network + pgadmin: + image: dpage/pgadmin4:latest + container_name: pgadmin + environment: + PGADMIN_DEFAULT_EMAIL: admin@sonnet.com + PGADMIN_DEFAULT_PASSWORD: admin + PGADMIN_CONFIG_SERVER_MODE: 'False' + ports: + - "5050:80" + volumes: + - pgadmin_data:/var/lib/pgadmin + depends_on: + - pgduckdb + networks: + - sonnet_network + + # Storage containers minio: image: minio/minio:latest container_name: minio @@ -44,9 +63,21 @@ services: - 9001:9001 - 9000:9000 command: ["server", "/data", "--console-address", ":9001"] + volumes: + - minio_data:/data + networks: + - sonnet_network volumes: pgduckdb_data: driver: local + pgadmin_data: + driver: local + minio_data: + driver: local data: driver: local + +networks: + sonnet_network: + driver: bridge diff --git a/linuxbase/Dockerfile b/linuxbase/Dockerfile index 60ab5a4..7532036 100644 --- a/linuxbase/Dockerfile +++ b/linuxbase/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM ubuntu:24.04 AS builder +FROM --platform=$BUILDPLATFORM alpine:3.18 AS builder # Set build arguments for cross-compilation ARG TARGETPLATFORM @@ -10,16 +10,14 @@ RUN echo "Sonnet Scripts running on $BUILDPLATFORM, building for $TARGETPLATFORM ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8 \ - TZ="America/Chicago" \ - DEBIAN_FRONTEND=noninteractive - -# Update and install required packages for common build dependencies -RUN apt-get update && apt-get upgrade -y && \ - apt-get install -y --no-install-recommends \ - locales git curl wget vim bash unzip \ - gcc build-essential openssl ca-certificates && \ - locale-gen en_US.UTF-8 && \ - rm -rf /var/lib/apt/lists/* + TZ="America/Chicago" + +# Install minimal build dependencies +RUN apk add --no-cache \ + ca-certificates openssl \ + git curl wget bash unzip \ + build-base libc6-compat gcc musl-dev && \ + rm -rf /var/lib/apk/lists/* # (Placeholder) Insert cross-compilation-specific build commands here # RUN if [ "$TARGETARCH" = "arm64" ]; then \