From 0ec66f0f2d912bffb6b998087620205f1efbb29c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 27 Dec 2022 15:17:33 +0530 Subject: [PATCH] fix: docker setup --- docker-compose.yml | 25 ------------------------- docker/docker-compose.yml | 32 ++++++++++++++++++++++++++++++++ docker/init.sh | 39 +++++++++++++++++++++++++++++++++++++++ lms/public/css/style.css | 6 +++--- 4 files changed, 74 insertions(+), 28 deletions(-) delete mode 100644 docker-compose.yml create mode 100644 docker/docker-compose.yml create mode 100644 docker/init.sh diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 90e9e0d3..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: "3" - -services: - mariadb: - image: mariadb - volumes: - - mariadb-storage:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=root - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - bench: - image: anandology/frappe-bench:2021.10 - volumes: - - .:/opt/frappe-bench/apps/lms - environment: - - FRAPPE_APPS=lms - - FRAPPE_ALLOW_TESTS=true - - FRAPPE_SITE_NAME=frappe.localhost - depends_on: - - mariadb - ports: - - 8000:8000 - - 9000:9000 -volumes: - mariadb-storage: {} diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..2c07829f --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,32 @@ +version: "3.7" +name: gameplan +services: + mariadb: + image: mariadb:10.6 + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --skip-character-set-client-handshake + - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 + environment: + MYSQL_ROOT_PASSWORD: 123 + volumes: + - mariadb-data:/var/lib/mysql + + redis: + image: redis:alpine + + frappe: + image: frappe/bench:latest + command: bash /workspace/init.sh + environment: + - SHELL=/bin/bash + working_dir: /home/frappe + volumes: + - .:/workspace + ports: + - 8000:8000 + - 9000:9000 + +volumes: + mariadb-data: diff --git a/docker/init.sh b/docker/init.sh new file mode 100644 index 00000000..eefc8562 --- /dev/null +++ b/docker/init.sh @@ -0,0 +1,39 @@ +#!bin/bash + +if [ -d "/home/frappe/frappe-bench/apps/frappe" ]; then + echo "Bench already exists, skipping init" + cd frappe-bench + bench start +else + echo "Creating new bench..." +fi + +bench init --skip-redis-config-generation frappe-bench + +cd frappe-bench + +# Use containers instead of localhost +bench set-mariadb-host mariadb +bench set-redis-cache-host redis:6379 +bench set-redis-queue-host redis:6379 +bench set-redis-socketio-host redis:6379 + +# Remove redis, watch from Procfile +sed -i '/redis/d' ./Procfile +sed -i '/watch/d' ./Procfile + +bench get-app lms + +bench new-site lms.localhost \ +--force \ +--mariadb-root-password 123 \ +--admin-password admin \ +--no-mariadb-socket + +bench --site lms.localhost install-app lms +bench --site lms.localhost set-config developer_mode 1 +bench --site lms.localhost clear-cache +bench --site lms.localhost set-config mute_emails 1 +bench use lms.localhost + +bench start diff --git a/lms/public/css/style.css b/lms/public/css/style.css index 1697920b..2392a81b 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -1766,11 +1766,11 @@ li { } .modal-header { - padding: 1.5rem 1.5rem 0 !important; + padding: 1rem 1rem 0 !important; } .modal-body { - padding: 0 1.5rem !important; + padding: 0 1rem !important; } .modal-content { @@ -1778,7 +1778,7 @@ li { } .modal-header, .modal-body { - margin-bottom: 1rem !important; + margin-bottom: 0.5rem !important; } .modal-header {