Skip to content

Commit

Permalink
update: separate minio into new docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
ntheanh201 committed Nov 22, 2024
1 parent 4a82a45 commit f54ffef
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 45 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ cd docker
# Copy the example config
cp ../config.env.example config.env
# Open config.env and change the variables.
```

### Run with MinIO (local S3-compatible storage)

```shell
docker compose -f docker-compose.yml -f minio/docker-compose.minio.yml --env-file minio/minio.env up -d
```

### Run with your own S3-compatible storage (update S3\_\* variables in config.env)

```shell
docker compose up -d
```

Expand Down
60 changes: 15 additions & 45 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: "3"
volumes:
superstreamer_redis_data:
superstreamer_postgres_data:
superstreamer_minio_data:

services:
superstreamer-app:
Expand All @@ -27,11 +26,11 @@ services:
- REDIS_HOST=superstreamer-redis
- REDIS_PORT=6379
- DATABASE_URI=postgresql://postgres:sprs@superstreamer-postgres/sprs
- S3_ENDPOINT=http://superstreamer-minio:9000
- S3_REGION=us-east-1
- S3_ACCESS_KEY=minioadmin
- S3_SECRET_KEY=minioadmin
- S3_BUCKET=superstreamer
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_REGION=${S3_REGION}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_BUCKET=${S3_BUCKET}

superstreamer-stitcher:
image: "superstreamerapp/stitcher:alpha"
Expand All @@ -46,11 +45,11 @@ services:
- REDIS_PORT=6379
- PUBLIC_API_ENDPOINT=http://localhost:52001
- PUBLIC_STITCHER_ENDPOINT=http://localhost:52002
- S3_ENDPOINT=http://superstreamer-minio:9000
- S3_REGION=us-east-1
- S3_ACCESS_KEY=minioadmin
- S3_SECRET_KEY=minioadmin
- S3_BUCKET=superstreamer
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_REGION=${S3_REGION}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_BUCKET=${S3_BUCKET}

superstreamer-artisan:
image: "superstreamerapp/artisan:alpha"
Expand All @@ -61,11 +60,11 @@ services:
environment:
- REDIS_HOST=superstreamer-redis
- REDIS_PORT=6379
- S3_ENDPOINT=http://superstreamer-minio:9000
- S3_REGION=us-east-1
- S3_ACCESS_KEY=minioadmin
- S3_SECRET_KEY=minioadmin
- S3_BUCKET=superstreamer
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_REGION=${S3_REGION}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_BUCKET=${S3_BUCKET}

superstreamer-redis:
image: redis/redis-stack-server:7.2.0-v6
Expand All @@ -88,32 +87,3 @@ services:
- POSTGRES_INITDB_ARGS=--data-checksums
- POSTGRES_DB=sprs
- POSTGRES_PASSWORD=sprs

superstreamer-minio:
image: quay.io/minio/minio
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
ports:
- "9000:9000" # API
- "9001:9001" # Console
volumes:
- superstreamer_minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5

createbuckets:
image: minio/mc
depends_on:
superstreamer-minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://superstreamer-minio:9000 minioadmin minioadmin;
mc mb myminio/superstreamer;
exit 0;
"
34 changes: 34 additions & 0 deletions docker/minio/docker-compose.minio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3"

volumes:
superstreamer_minio_data:

services:
superstreamer-minio:
image: quay.io/minio/minio
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
ports:
- "9000:9000" # API
- "9001:9001" # Console
volumes:
- superstreamer_minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5

createbuckets:
image: minio/mc
depends_on:
superstreamer-minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://superstreamer-minio:9000 minioadmin minioadmin;
mc mb myminio/superstreamer;
exit 0;
"
6 changes: 6 additions & 0 deletions docker/minio/minio.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# MinIO Configuration
S3_ENDPOINT=http://superstreamer-minio:9000
S3_REGION=us-east-1
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=superstreamer

0 comments on commit f54ffef

Please sign in to comment.