Skip to content

Playground project for testing Minio Cloud Storage using Docker & AWS PHP SDK

Notifications You must be signed in to change notification settings

aanton/docker-minio-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker application using Minio & PHP backend

Playground project to work with Minio Cloud Storage.

Features:

  • Create a bucket & its public policy on first usage (in the APP)
  • Upload files
  • List uploaded files
  • Persist data in a docker volume

Requirements

  • Docker & Docker Compose
  • VirtualBox & Docker Machine for playing with a remote docker host

Installation using a local docker host/daemon

  1. Clone this project
  2. Install APP dependencies
  3. Start the containers
  4. Browse http://localhost/index.php

Clone this project

git clone https://github.com/aanton/docker-minio-demo.git docker-minio-demo
cd docker-minio-demo

Install APP dependencies

Run composer locally in the app folder:

composer install --working-dir app

Start the containers

docker-compose up # stop them: CTRL+C
docker-compose up -d # stop them using: docker-compose down

Cleanup

  • Stop & remove containers & networks
  • Remove uploaded files
docker-compose down

sudo find .minio -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;

Installation using a docker host/daemon in a virtual machine

  1. Create the virtual machine (VirtualBox is used)
    • Set share folder
  2. Set the docker client to connect to use the remote docker host/daemon
  3. Clone this project in the container
  4. Install APP dependencies in the container
  5. Start the containers
  6. Browse http://[docker-host]/index.php

Create virtual machine

# Set the local working directory
mkdir demo-minio && cd $_

# Create virtual machine
docker-machine create -d virtualbox --virtualbox-share-folder $(pwd):$(pwd) vm1

# Get docker host IP
docker-machine ip vm1

Set the docker client

# Set the (local) docker client to wotk with the remote docker host/daemon
eval $(docker-machine env vm1)

# Check there are no images, containers & volumes in the remote docker host/daemon
docker system df

Clone this project

docker run --rm \
    --volume $(pwd):/git \
    --user $(id -u):$(id -g) \
    composer \
    git clone https://github.com/aanton/docker-minio-demo.git /git

Install APP dependencies

Run composer in the app folder:

docker run --rm --interactive --tty \
    --volume $(pwd)/app:/app \
    --user $(id -u):$(id -g) \
    composer install

Start the containers

  • Set docker host IP (required in docker-compose.yml)
  • Start the containers
export DOCKER_HOST_IP=$(docker-machine ip ${DOCKER_MACHINE_NAME:-default})

docker-compose up # stop them: CTRL+C
docker-compose up -d # stop them using: docker-compose down

Cleanup

  • Stop & remove containers & networks
  • Stop & destroy virtual machine
  • Remove uploaded files
docker-compose down

docker-machine stop vm1
docker-machine rm vm1

sudo find .minio -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;

About

Playground project for testing Minio Cloud Storage using Docker & AWS PHP SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages