From 916b42483e08e2476489d26343ae0f71837aab19 Mon Sep 17 00:00:00 2001 From: Bohdan Kucherivayi Date: Thu, 15 Feb 2024 17:33:46 +0200 Subject: [PATCH 1/2] fix: compose files --- compose.yaml | 2 +- docker-compose.yml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compose.yaml b/compose.yaml index b9d45209..0ce46da9 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,5 +1,5 @@ x-customizable-image: &customizable_image - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest x-depends-on-configurator: &depends_on_configurator depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index ce1e1957..dfe62e0b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: configurator: condition: service_completed_successfully required: true - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -37,7 +37,7 @@ services: REDIS_CACHE: redis-cache:6379 REDIS_QUEUE: redis-queue:6379 SOCKETIO_PORT: "9000" - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -87,7 +87,7 @@ services: UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1 UPSTREAM_REAL_IP_HEADER: X-Forwarded-For UPSTREAM_REAL_IP_RECURSIVE: "off" - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -106,7 +106,7 @@ services: configurator: condition: service_completed_successfully required: true - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -125,7 +125,7 @@ services: configurator: condition: service_completed_successfully required: true - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -160,7 +160,7 @@ services: configurator: condition: service_completed_successfully required: true - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -177,7 +177,7 @@ services: configurator: condition: service_completed_successfully required: true - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest networks: default: null volumes: @@ -200,11 +200,11 @@ x-backend-defaults: depends_on: configurator: condition: service_completed_successfully - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest volumes: - ./data:/home/zapal/frappe-bench x-customizable-image: - image: zapal-tech/erp:latest + image: ghcr.io/zapal-tech/erp:latest x-depends-on-configurator: depends_on: configurator: From ab20bf6b80f0e7f82fb254e6022e1e9924271a6b Mon Sep 17 00:00:00 2001 From: Bohdan Kucherivayi Date: Thu, 15 Feb 2024 20:20:26 +0200 Subject: [PATCH 2/2] 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", \