Skip to content

Commit

Permalink
README.md and README.Docker.md have been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
theriverman committed Aug 8, 2021
1 parent 3ea0f03 commit bb3d448
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
37 changes: 21 additions & 16 deletions README.Docker.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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. <br>
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:
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. <br>
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
Expand All @@ -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)

Expand Down

0 comments on commit bb3d448

Please sign in to comment.