From bb3d44871fb7d3cf92dbfbffbacbfd9b3c7a080c Mon Sep 17 00:00:00 2001 From: Kristof Daja Date: Sun, 8 Aug 2021 17:14:09 +0200 Subject: [PATCH] README.md and README.Docker.md have been updated --- README.Docker.md | 37 +++++++++++++++++++++---------------- README.md | 12 +++++++----- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/README.Docker.md b/README.Docker.md index d0e81a2..a271408 100644 --- a/README.Docker.md +++ b/README.Docker.md @@ -1,23 +1,14 @@ -# Demo Description for Docker Compose +# Docker Compose Description for django-minio-backend Execute the following step to start a demo environment using Docker Compose: **Start the Docker Compose services:** ```shell - docker-compose up + docker-compose up -d + docker-compose exec web python manage.py createsuperuser --noinput + docker-compose exec web python manage.py collectstatic --noinput ``` - Leave this shell instance intact to keep your Docker services running! -# Django Admin -Open your browser at http://localhost:8000/admin to access the Django admin portal: - * username: `admin` - * password: `123123` - -# MinIO Console -Open your browser at http://localhost:9001 to access the MiniIO Console: - * username: `minio` - * password: `minio123` - -# docker-compose.yml +## About docker-compose.yml Note the following lines in `docker-compose.yml`: ```yaml environment: @@ -27,10 +18,24 @@ Note the following lines in `docker-compose.yml`: GH_MINIO_EXTERNAL_ENDPOINT_USE_HTTPS: "false" ``` -The value of `GH_MINIO_ENDPOINT` is `nginx:9000` because in the used [docker-compose.yml](docker-compose.yml) file the minio instances are load balanced by NGINX. -This means we're not interacting with the four minio1...minio4 instances directly but through the NGINX reverse-proxy. +MinIO is load balanced by nginx, so all connections made from Django towards MinIO happens through the internal `nginx` FQDN.
+Therefore, the value of `GH_MINIO_ENDPOINT` is `nginx:9000`. + +# Web Access +Both Django(:8000) and MinIO(:9001) expose a Web GUI and their ports are mapped to the host machine. + +## Django Admin +Open your browser at http://localhost:8000/admin to access the Django admin portal: + * username: `admin` + * password: `123123` + +## MinIO Console +Open your browser at http://localhost:9001 to access the MiniIO Console: + * username: `minio` + * password: `minio123` # Developer Environment +An alternative docker-compose file is available for **django-minio-backend** which does not copy the source files into the container, but maps them as a volume. **Input file**: `docker-compose.develop.yml` If you would like to develop in a Docker Compose environment, execute the following commands: diff --git a/README.md b/README.md index 15bc1ac..9b3e1ed 100644 --- a/README.md +++ b/README.md @@ -173,13 +173,18 @@ The following list summarises the key characteristics of **django-minio-backend* See **Networking** below for a thorough explanation * The uploaded object's content-type is guessed during save. If `mimetypes.guess_type` fails to determine the correct content-type, then it falls back to `application/octet-stream`. -## Networking +## Networking and Docker If your Django application is running on a shared host with your MinIO instance, you should consider using the `MINIO_EXTERNAL_ENDPOINT` and `MINIO_EXTERNAL_ENDPOINT_USE_HTTPS` parameters. -This way most traffic will happen internally between Django and MinIO. The external_endpoint parameters are required for external pre-signed URL generation. +This way most traffic will happen internally between Django and MinIO. The external endpoint parameters are required for external pre-signed URL generation. If your Django application and MinIO instance are running on different hosts, you can omit the `MINIO_EXTERNAL_ENDPOINT` and `MINIO_EXTERNAL_ENDPOINT_USE_HTTPS` parameters, and **django-minio-backend** will default to the value of `MINIO_ENDPOINT`. +Setting up and configuring custom networks in Docker is not in the scope of this document.
+To learn more about Docker networking, see [Networking overview](https://docs.docker.com/network/) and [Networking in Compose](https://docs.docker.com/compose/networking/). + +See [README.Docker.md](README.Docker.md) for a real-life Docker Compose demonstration. + ## Compatibility * Django 2.2 or later * Python 3.6.0 or later @@ -188,9 +193,6 @@ and **django-minio-backend** will default to the value of `MINIO_ENDPOINT`. **Note:** This library relies heavily on [PEP 484 -- Type Hints](https://www.python.org/dev/peps/pep-0484/) which was introduced in *Python 3.5.0*. -## Docker -See [README.Docker.md](README.Docker.md) for a real-life Docker Compose demonstration. - ## Contribution Please find the details in [CONTRIBUTE.md](CONTRIBUTE.md)