Error with setting up minIO in docker-compose: <ERROR> Unable to initialize new alias from the provided credentials

Viewed 101

I have trouble with setting up minIO in my docker-compose. I found this problem on several websites and tried to make it work. But I failed :D

Anyway, if anyone is able to help me I will call him my personal hero. Here is my code:

# docker-compose.yml

  minio:
    container_name: minio
    image: minio/minio
    ports:
      - "9000:9000"
    volumes:
      - ./minio-data:/data
    env_file:
      - app/.env
    command: server /minio-data

  mc:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      until (/usr/bin/mc config host add myminio http://minio:9000 access-key secret-key) do echo '...waiting...' && sleep 1; done;
      /usr/bin/mc mb myminio/local-bucket/;
      /usr/bin/mc policy set download myminio/local-bucket;
      exit 0;
      "


# settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

AWS_ACCESS_KEY_ID = env.str("MINIO_ACCESS_KEY", default='access-key')
AWS_SECRET_ACCESS_KEY = env.str("MINIO_SECRET_KEY", default='secret-key')
AWS_STORAGE_BUCKET_NAME = env.str("AWS_STORAGE_BUCKET_NAME", default='local-bucket')

MINIO_STORAGE_USE_HTTPS = False

if DEBUG:
    AWS_S3_ENDPOINT_URL = env.str("AWS_S3_ENDPOINT_URL", default='http://minio:9000')


# .env

MINIO_ACCESS_KEY=access-key
MINIO_SECRET_KEY=secret-key
AWS_STORAGE_BUCKET_NAME=local-bucket
AWS_S3_ENDPOINT_URL=http://minio:9000

And thats my console logs:

enter image description here

0 Answers
Related