From 841c210a4ec16655ec5b88eb8709bb30be097abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Tue, 5 Sep 2023 11:23:31 +0200 Subject: [PATCH 1/3] feat: update docker-compose to enable django upgrade --- docker-compose.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2c16c88..e5fdf08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,21 @@ version: '3' services: ldap: image: osixia/openldap:1.1.7 - + # minio: + # container_name: minio + # image: minio/minio:RELEASE.2023-08-31T15-31-16Z + # environment: + # - MINIO_ROOT_USER=admin + # - MINIO_ROOT_PASSWORD=MinioPassword + # - MINIO_VOLUMES=/mnt/data + # volumes: + # - minio:/mnt/data + # ports: + # - "9000:9000" + # - "9090:9090" mysql: container_name: mysql - image: mysql:5.7 + image: mysql:8.1 environment: - MYSQL_ROOT_PASSWORD=ninetofiver - MYSQL_DATABASE=ninetofiver @@ -31,7 +42,7 @@ services: build: context: 925r dockerfile: Dockerfile - command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" + command: bash -c "python manage.py migrate && python -Wa manage.py runserver 0.0.0.0:8000" container_name: 925r hostname: 925r expose: @@ -63,4 +74,5 @@ services: - 925r volumes: + # minio: mysql: From 03fd279fbb76a3c5809b3216d40e47e1b0babc4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Mon, 11 Sep 2023 08:42:05 +0200 Subject: [PATCH 2/3] feat: minio --- README.md | 10 ++++++++++ docker-compose.yml | 35 ++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 00c6c63..0b898ac 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,16 @@ Run script to clone required repositories. ```shell ./init-script.sh ``` + +Run minio and create an access key and a secret key (default in `dev` config is `minio` and `minio-client`) +```sh +docker compose up minio -d +``` + +http://127.0.0.1:9090/access-keys/new-account + +For production, pass the Access Key and Secret Key to 925r settings (`MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` variables) + Run docker-compose command to start 925r and YaYata. This step will perform also apply of 925r migrations. ```shell diff --git a/docker-compose.yml b/docker-compose.yml index e5fdf08..ada6ad6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,18 +2,26 @@ version: '3' services: ldap: image: osixia/openldap:1.1.7 - # minio: - # container_name: minio - # image: minio/minio:RELEASE.2023-08-31T15-31-16Z - # environment: - # - MINIO_ROOT_USER=admin - # - MINIO_ROOT_PASSWORD=MinioPassword - # - MINIO_VOLUMES=/mnt/data - # volumes: - # - minio:/mnt/data - # ports: - # - "9000:9000" - # - "9090:9090" + minio: + hostname: minio + container_name: minio + image: minio/minio:RELEASE.2023-08-31T15-31-16Z + environment: + - MINIO_ROOT_USER=admin + - MINIO_ROOT_PASSWORD=MinioPassword + - MINIO_VOLUMES=/mnt/data + volumes: + - minio:/mnt/data + ports: + - "9000:9000" + - "9090:9090" + command: + [ + "minio", + "server", + "--console-address", + ":9090" + ] mysql: container_name: mysql image: mysql:8.1 @@ -54,6 +62,7 @@ services: depends_on: - ldap - mysql + - minio yayata: container_name: yayata @@ -74,5 +83,5 @@ services: - 925r volumes: - # minio: + minio: mysql: From 190d57f43089f198ed66cf7d2f9bd88ddae1024e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Tue, 12 Sep 2023 10:24:45 +0200 Subject: [PATCH 3/3] feat: switch to gunicorn --- docker-compose.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ada6ad6..fbc7e53 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,8 @@ services: container_name: minio image: minio/minio:RELEASE.2023-08-31T15-31-16Z environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=MinioPassword + - MINIO_ROOT_USER=minio + - MINIO_ROOT_PASSWORD=minio-client - MINIO_VOLUMES=/mnt/data volumes: - minio:/mnt/data @@ -50,13 +50,14 @@ services: build: context: 925r dockerfile: Dockerfile - command: bash -c "python manage.py migrate && python -Wa manage.py runserver 0.0.0.0:8000" + # command: bash -c "python manage.py migrate && python -Wa manage.py runserver 0.0.0.0:8000" + command: bash -c "python manage.py migrate && pipenv run gunicorn --pid /run/gunicorn/ninetofiver.pid --bind 0.0.0.0:9101 --env ENVIRONMENT=production --timeout 60 --workers=5 --worker-class sync --worker-connections 1000 --access-logfile /var/log/gunicorn/access-ninetofiver.log --error-logfile /var/log/gunicorn/error-ninetofiver.log --capture-output ninetofiver.wsgi" container_name: 925r hostname: 925r expose: - - "8000" + - "9101" ports: - - "8888:8000" + - "8888:9101" volumes: - ./925r:/code depends_on: