ddev-contrib icon indicating copy to clipboard operation
ddev-contrib copied to clipboard

Add MinIO Docker Compose Service

Open NBZ4live opened this issue 3 years ago • 14 comments

The New Solution/Problem/Issue/Bug:

This recipe adds a MinIO container to a project.

MinIO is a S3 compatible object-storage. It can be used, to run an S3 instance locally, in case the hosted S3 is not reachable (like developing while offline)

Manual Testing Instructions:

Follow the instructions from docker-compose-services/minio/README.md. Expected result:

  • A working MinIO instance is available in the project.
  • The object browser is available at https://<projectname>.ddev.site:9000.
  • All files uploaded through the object browser can be listed with ddev exec -s minio ls -al /data/default

NBZ4live avatar Nov 07 '21 17:11 NBZ4live

Thanks!

rfay avatar Nov 08 '21 01:11 rfay

Looking forward to getting this in @NBZ4live and thanks for the contribution. Please just pull the suggested commits and rebase and respond to other comments and we can move forward.

rfay avatar Jan 15 '22 21:01 rfay

Tried following the steps but unfortunately doesn't seem to be working. Do you know if this should work with the m1 chips?

smustgrave avatar Jun 17 '22 20:06 smustgrave

https://drupal9-ddev.ddev.site:9000/ redirects to http://drupal9-ddev.ddev.site:39085/ and throws a connection refused error

When I change the port from 9000 to 9005 and try to visit the url I get

502: Unresponsive/broken ddev back-end site. This is the ddev-router container: The back-end webserver at the URL you specified is not responding. You may want to use "ddev restart" to restart the site.

smustgrave avatar Jun 17 '22 20:06 smustgrave

Okay finally got it working

`version: '3.6' services: minio: container_name: ddev-${DDEV_SITENAME}-minio build: context: './minio-build' restart: always ports: - "9010" labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT environment: - VIRTUAL_HOST=$DDEV_HOSTNAME - HTTP_EXPOSE=9011:9010 - HTTPS_EXPOSE=9010:9010 - MINIO_ROOT_USER=minio - MINIO_ROOT_PASSWORD=minio123 command: server /data --console-address :9010 volumes: - type: "volume" source: minio target: "/data" volume: nocopy: true - type: "bind" source: "." target: "/mnt/ddev_config" web: links: - minio:$DDEV_HOSTNAME

volumes: minio: name: "${DDEV_SITENAME}-minio" `

smustgrave avatar Jun 17 '22 21:06 smustgrave

@mglaman points out that he has minio going on https://github.com/bluehorndigital/mojo

rfay avatar Jun 21 '22 18:06 rfay

Hi @rfay any info on this? I was hoping to have a service as well for local development.

if I use this file

version: '3.6'
services:
  storage:
    container_name: ddev-${DDEV_SITENAME}-minio
    image: minio/minio
    command: 'server /data --console-address ":9001" --address ":8080" '
    volumes:
      - storage:/data
    environment:
      - LOG_LEVEL=trace
      - MINIO_ROOT_USER=minioadmin
      - MINIO_ROOT_PASSWORD=minioadmin
      - MINIO_DOMAIN=storage
      # DDEV configurations to expose MinIO over the network.
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - HTTP_EXPOSE=8081:8080
      - HTTPS_EXPOSE=8080:8080
    expose:
      - '8080'
      - '9001'
    labels:
      # These labels ensure this service is discoverable by ddev
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    networks:
      default:
        aliases:
          - mojodata.storage
  storage_cli:
    container_name: ddev-${DDEV_SITENAME}-mc
    image: minio/mc
    depends_on:
      - storage
    entrypoint: /bin/bash
    stdin_open: true
    tty: true

  web:
    environment:
      FILESYSTEM_DRIVER: s3
      AWS_ACCESS_KEY_ID: minioadmin
      AWS_SECRET_ACCESS_KEY: minioadmin
      AWS_DEFAULT_REGION: us-east-1
      S3_BUCKET: mojodata
      S3_PROTOCOL: https
      S3_CNAME: ${DDEV_SITENAME}.ddev.site:8080
      S3_ENDPOINT: http://storage:8080
      S3_USE_PATH_STYLE_ENDPOINT: 1
      S3_CNAME_IS_BUCKET: 0
    links:
      - storage:$DDEV_HOSTNAME
volumes:
  storage:

there are issues in starting up the project. Is there any specific thing that I need to adjust in here?

zaifastafa avatar Nov 11 '22 12:11 zaifastafa

@zaifastafa please say what the issues are, and maybe somebody can help you.

It would be great if somebody who uses this would turn it into a ddev add-on.

rfay avatar Nov 11 '22 13:11 rfay

When this file is added and I do ddev restart, the project starts fine but when opening the project it gives 503 ddev error.

zaifastafa avatar Nov 11 '22 13:11 zaifastafa

A 503 normally means you have the wrong docroot or that the docroot has no index.php in it. ddev logs may help you understand the 503.

Please do a standard trivial working project, maybe Drupal9 quickstart or something, and add this, and see if you still have the problem.

rfay avatar Nov 11 '22 13:11 rfay

Hello,

I've implemented a full DDEV MinIO addon here. It exposes 9000 only locally, and gets a random port for localhost.

https://github.com/oblakstudio/ddev-minio

Fully tested and it works

seebeen avatar Aug 14 '23 12:08 seebeen

FWIW, I have been using @seebeen's ddev-minio and it is working great.

timkelty avatar Dec 14 '23 20:12 timkelty

@rfay can we move the ddev-minio to the official namespace?

seebeen avatar Jan 18 '24 11:01 seebeen

Sure, please open an issue in ddev-minio. I'm in Chile, it may be a while but we'll do it.

rfay avatar Jan 18 '24 11:01 rfay