fix: config issues
This commit is contained in:
parent
839eeac2c2
commit
02c936e880
|
|
@ -34,11 +34,11 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- banatie-network
|
- banatie-network
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: banatie
|
POSTGRES_DB: banatie_db
|
||||||
POSTGRES_USER: banatie_user
|
POSTGRES_USER: banatie_user
|
||||||
POSTGRES_PASSWORD: banatie_secure_password
|
POSTGRES_PASSWORD: banatie_secure_password
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U banatie_user -d banatie"]
|
test: ["CMD-SHELL", "pg_isready -U banatie_user -d banatie_db"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
@ -84,45 +84,46 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
minio:
|
minio:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
entrypoint: >
|
entrypoint:
|
||||||
/bin/sh -c "
|
- /bin/sh
|
||||||
echo 'Setting up MinIO alias...';
|
- -c
|
||||||
mc alias set storage http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
|
- |
|
||||||
|
echo 'Setting up MinIO alias...'
|
||||||
|
mc alias set storage http://minio:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}
|
||||||
|
|
||||||
echo 'Creating main bucket...';
|
echo 'Creating main bucket...'
|
||||||
mc mb --ignore-existing storage/banatie;
|
mc mb --ignore-existing storage/banatie
|
||||||
|
|
||||||
echo 'Creating service user...';
|
echo 'Creating service user...'
|
||||||
mc admin user add storage banatie_service banatie_service_key_2024;
|
mc admin user add storage banatie_service banatie_service_key_2024
|
||||||
|
|
||||||
echo 'Attaching readwrite policy to service user...';
|
echo 'Attaching readwrite policy to service user...'
|
||||||
mc admin policy attach storage readwrite --user=banatie_service;
|
mc admin policy attach storage readwrite --user=banatie_service
|
||||||
|
|
||||||
echo 'Setting up lifecycle policy...';
|
echo 'Setting up lifecycle policy...'
|
||||||
cat > /tmp/lifecycle.json << EOF
|
cat > /tmp/lifecycle.json <<'LIFECYCLE'
|
||||||
{
|
{
|
||||||
\"Rules\": [
|
"Rules": [
|
||||||
{
|
{
|
||||||
\"ID\": \"temp-cleanup\",
|
"ID": "temp-cleanup",
|
||||||
\"Status\": \"Enabled\",
|
"Status": "Enabled",
|
||||||
\"Filter\": {
|
"Filter": {
|
||||||
\"Prefix\": \"temp/\"
|
"Prefix": "temp/"
|
||||||
},
|
},
|
||||||
\"Expiration\": {
|
"Expiration": {
|
||||||
\"Days\": 7
|
"Days": 7
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
]
|
}
|
||||||
}
|
LIFECYCLE
|
||||||
EOF
|
mc ilm import storage/banatie < /tmp/lifecycle.json
|
||||||
mc ilm import storage/banatie < /tmp/lifecycle.json;
|
|
||||||
|
|
||||||
echo 'Storage initialization completed!';
|
echo 'Storage initialization completed!'
|
||||||
echo 'Bucket: banatie';
|
echo 'Bucket: banatie'
|
||||||
echo 'Using presigned URLs for secure access';
|
echo 'Using presigned URLs for secure access'
|
||||||
echo 'SNMD mode: Full S3 compatibility enabled';
|
echo 'SNMD mode: Full S3 compatibility enabled'
|
||||||
exit 0;
|
exit 0
|
||||||
"
|
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue