From ab20bf6b80f0e7f82fb254e6022e1e9924271a6b Mon Sep 17 00:00:00 2001 From: Bohdan Kucherivayi Date: Thu, 15 Feb 2024 20:20:26 +0200 Subject: [PATCH] fixes --- compose.yaml | 4 +- docker-compose.yml | 74 ++++++++++++++++++++++++++++----- images/custom/Containerfile | 8 +++- images/production/Containerfile | 8 +++- 4 files changed, 78 insertions(+), 16 deletions(-) diff --git a/compose.yaml b/compose.yaml index 0ce46da9..11717aa5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -9,7 +9,9 @@ x-depends-on-configurator: &depends_on_configurator x-backend-defaults: &backend_defaults <<: [*depends_on_configurator, *customizable_image] volumes: - - ./data:/home/zapal/frappe-bench + - ./data/sites:/home/zapal/frappe-bench/sites + - ./data/sites-assets:/home/zapal/frappe-bench/sites/assets + - ./data/logs:/home/zapal/frappe-bench/logs services: configurator: diff --git a/docker-compose.yml b/docker-compose.yml index dfe62e0b..f83dac04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,18 @@ services: default: null volumes: - type: bind - source: ./data - target: /home/zapal/frappe-bench + source: ./data/sites + target: /home/zapal/frappe-bench/sites + bind: + create_host_path: true + - type: bind + source: ./data/sites-assets + target: /home/zapal/frappe-bench/sites/assets + bind: + create_host_path: true + - type: bind + source: ./data/logs + target: /home/zapal/frappe-bench/logs bind: create_host_path: true configurator: @@ -42,8 +52,18 @@ services: default: null volumes: - type: bind - source: ./data - target: /home/zapal/frappe-bench + source: ./data/sites + target: /home/zapal/frappe-bench/sites + bind: + create_host_path: true + - type: bind + source: ./data/sites-assets + target: /home/zapal/frappe-bench/sites/assets + bind: + create_host_path: true + - type: bind + source: ./data/logs + target: /home/zapal/frappe-bench/logs bind: create_host_path: true db: @@ -111,8 +131,18 @@ services: default: null volumes: - type: bind - source: ./data - target: /home/zapal/frappe-bench + source: ./data/sites + target: /home/zapal/frappe-bench/sites + bind: + create_host_path: true + - type: bind + source: ./data/sites-assets + target: /home/zapal/frappe-bench/sites/assets + bind: + create_host_path: true + - type: bind + source: ./data/logs + target: /home/zapal/frappe-bench/logs bind: create_host_path: true queue-short: @@ -130,8 +160,18 @@ services: default: null volumes: - type: bind - source: ./data - target: /home/zapal/frappe-bench + source: ./data/sites + target: /home/zapal/frappe-bench/sites + bind: + create_host_path: true + - type: bind + source: ./data/sites-assets + target: /home/zapal/frappe-bench/sites/assets + bind: + create_host_path: true + - type: bind + source: ./data/logs + target: /home/zapal/frappe-bench/logs bind: create_host_path: true redis-cache: @@ -165,8 +205,18 @@ services: default: null volumes: - type: bind - source: ./data - target: /home/zapal/frappe-bench + source: ./data/sites + target: /home/zapal/frappe-bench/sites + bind: + create_host_path: true + - type: bind + source: ./data/sites-assets + target: /home/zapal/frappe-bench/sites/assets + bind: + create_host_path: true + - type: bind + source: ./data/logs + target: /home/zapal/frappe-bench/logs bind: create_host_path: true websocket: @@ -202,7 +252,9 @@ x-backend-defaults: condition: service_completed_successfully image: ghcr.io/zapal-tech/erp:latest volumes: - - ./data:/home/zapal/frappe-bench + - ./data/sites:/home/zapal/frappe-bench/sites + - ./data/sites-assets:/home/zapal/frappe-bench/sites/assets + - ./data/logs:/home/zapal/frappe-bench/logs x-customizable-image: image: ghcr.io/zapal-tech/erp:latest x-depends-on-configurator: diff --git a/images/custom/Containerfile b/images/custom/Containerfile index f3a7552e..b242319c 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -132,7 +132,7 @@ RUN bench get-app --branch=${HRMS_BRANCH} --resolve-deps hrms ${HRMS_REPO} RUN echo "frappe\nhrms\nerpnext" > sites/apps.txt RUN echo "{}" > sites/common_site_config.json # DO NOT REMOVE .git FOLDERS -# RUN find apps -mindepth 1 -path "*/.git" | xargs git remote rm upstream +RUN find apps -mindepth 1 -path "*/.git" | xargs git remote rm upstream FROM base as erp @@ -144,7 +144,11 @@ COPY /usr/local/bin/nginx-entrypoint.sh /usr/local/bin/nginx-entrypoint.sh WORKDIR /home/zapal/frappe-bench -VOLUME ["/home/zapal/frappe-bench"] +VOLUME [ \ + "/home/zapal/frappe-bench/sites", \ + "/home/zapal/frappe-bench/sites/assets", \ + "/home/zapal/frappe-bench/logs" \ +] CMD [ \ "/home/zapal/frappe-bench/env/bin/gunicorn", \ diff --git a/images/production/Containerfile b/images/production/Containerfile index 68d7519b..da8e2266 100644 --- a/images/production/Containerfile +++ b/images/production/Containerfile @@ -126,7 +126,7 @@ RUN bench get-app --branch=${HRMS_BRANCH} --resolve-deps hrms ${HRMS_REPO} RUN echo "frappe\nhrms\nerpnext" > sites/apps.txt RUN echo "{}" > sites/common_site_config.json # DO NOT REMOVE .git FOLDERS -# RUN find apps -mindepth 1 -path "*/.git" | xargs git remote rm upstream +RUN find apps -mindepth 1 -path "*/.git" | xargs git remote rm upstream FROM base as erp @@ -136,7 +136,11 @@ COPY --from=builder --chown=zapal:zapal /home/zapal/frappe-bench /home/zapal/fra WORKDIR /home/zapal/frappe-bench -VOLUME ["/home/zapal/frappe-bench"] +VOLUME [ \ + "/home/zapal/frappe-bench/sites", \ + "/home/zapal/frappe-bench/sites/assets", \ + "/home/zapal/frappe-bench/logs" \ +] CMD [ \ "/home/zapal/frappe-bench/env/bin/gunicorn", \