forked from mirrors/pkg-proxy
Replace custom filesystem storage with gocloud.dev/blob for unified storage backend support. Supported backends: - file:///path/to/dir - Local filesystem (default) - s3://bucket-name - Amazon S3 - s3://bucket?endpoint=http://localhost:9000 - S3-compatible (MinIO) Configuration via: - CLI flag: -storage-url - Environment: PROXY_STORAGE_URL - Config file: storage.url The old storage.path config is deprecated but still supported.
109 lines
2.6 KiB
YAML
109 lines
2.6 KiB
YAML
services:
|
|
# SQLite + local filesystem (default)
|
|
proxy:
|
|
build: .
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- proxy-data:/data
|
|
environment:
|
|
- PROXY_LISTEN=:8080
|
|
- PROXY_BASE_URL=http://localhost:8080
|
|
- PROXY_STORAGE_PATH=/data/artifacts
|
|
- PROXY_DATABASE_PATH=/data/proxy.db
|
|
|
|
# PostgreSQL + local filesystem
|
|
proxy-postgres:
|
|
build: .
|
|
ports:
|
|
- "8081:8080"
|
|
volumes:
|
|
- proxy-artifacts:/data/artifacts
|
|
environment:
|
|
- PROXY_LISTEN=:8080
|
|
- PROXY_BASE_URL=http://localhost:8081
|
|
- PROXY_STORAGE_PATH=/data/artifacts
|
|
- PROXY_DATABASE_DRIVER=postgres
|
|
- PROXY_DATABASE_URL=postgres://proxy:proxy@postgres:5432/proxy?sslmode=disable
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
profiles:
|
|
- postgres
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
- POSTGRES_USER=proxy
|
|
- POSTGRES_PASSWORD=proxy
|
|
- POSTGRES_DB=proxy
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U proxy"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
profiles:
|
|
- postgres
|
|
|
|
# PostgreSQL + S3 (MinIO)
|
|
proxy-s3:
|
|
build: .
|
|
ports:
|
|
- "8082:8080"
|
|
environment:
|
|
- PROXY_LISTEN=:8080
|
|
- PROXY_BASE_URL=http://localhost:8082
|
|
- PROXY_STORAGE_URL=s3://proxy?endpoint=http://minio:9000&disableSSL=true&s3ForcePathStyle=true
|
|
- PROXY_DATABASE_DRIVER=postgres
|
|
- PROXY_DATABASE_URL=postgres://proxy:proxy@postgres:5432/proxy_s3?sslmode=disable
|
|
- AWS_ACCESS_KEY_ID=minioadmin
|
|
- AWS_SECRET_ACCESS_KEY=minioadmin
|
|
- AWS_REGION=us-east-1
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
minio-init:
|
|
condition: service_completed_successfully
|
|
profiles:
|
|
- s3
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
command: server /data --console-address ":9001"
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
environment:
|
|
- MINIO_ROOT_USER=minioadmin
|
|
- MINIO_ROOT_PASSWORD=minioadmin
|
|
volumes:
|
|
- minio-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "mc", "ready", "local"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
profiles:
|
|
- s3
|
|
|
|
minio-init:
|
|
image: minio/mc:latest
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
mc alias set myminio http://minio:9000 minioadmin minioadmin;
|
|
mc mb --ignore-existing myminio/proxy;
|
|
exit 0;
|
|
"
|
|
profiles:
|
|
- s3
|
|
|
|
volumes:
|
|
proxy-data:
|
|
proxy-artifacts:
|
|
postgres-data:
|
|
minio-data:
|