From 899d8fb37b502a8e010e78c459e57c54fef3a707 Mon Sep 17 00:00:00 2001 From: Bohdan Kucherivayi Date: Thu, 15 Feb 2024 23:54:28 +0200 Subject: [PATCH] fix: images --- compose.yaml | 6 +- docker-compose.yml | 105 ++++++++------------------------ images/custom/Containerfile | 9 +-- images/production/Containerfile | 9 +-- 4 files changed, 31 insertions(+), 98 deletions(-) diff --git a/compose.yaml b/compose.yaml index 11717aa5..1208977d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -9,9 +9,7 @@ x-depends-on-configurator: &depends_on_configurator x-backend-defaults: &backend_defaults <<: [*depends_on_configurator, *customizable_image] volumes: - - ./data/sites:/home/zapal/frappe-bench/sites - - ./data/sites-assets:/home/zapal/frappe-bench/sites/assets - - ./data/logs:/home/zapal/frappe-bench/logs + - erp-bench:/home/zapal/frappe-bench services: configurator: @@ -80,4 +78,4 @@ services: command: bench schedule volumes: - sites: + erp-bench: diff --git a/docker-compose.yml b/docker-compose.yml index f83dac04..f3057c62 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,21 +9,10 @@ services: networks: default: null volumes: - - type: bind - 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 + - type: volume + source: erp-bench + target: /home/zapal/frappe-bench + volume: {} configurator: command: - | @@ -51,21 +40,10 @@ services: networks: default: null volumes: - - type: bind - 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 + - type: volume + source: erp-bench + target: /home/zapal/frappe-bench + volume: {} db: command: - --character-set-server=utf8mb4 @@ -112,7 +90,7 @@ services: default: null volumes: - type: bind - source: ./data + source: /home/bohdan-kucheriavyi/Documents/Repositories/Zapal/erp/data target: /home/zapal/frappe-bench bind: create_host_path: true @@ -130,21 +108,10 @@ services: networks: default: null volumes: - - type: bind - 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 + - type: volume + source: erp-bench + target: /home/zapal/frappe-bench + volume: {} queue-short: command: - bench @@ -159,21 +126,10 @@ services: networks: default: null volumes: - - type: bind - 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 + - type: volume + source: erp-bench + target: /home/zapal/frappe-bench + volume: {} redis-cache: image: redis:6.2-alpine networks: @@ -204,21 +160,10 @@ services: networks: default: null volumes: - - type: bind - 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 + - type: volume + source: erp-bench + target: /home/zapal/frappe-bench + volume: {} websocket: command: - node @@ -232,7 +177,7 @@ services: default: null volumes: - type: bind - source: ./data + source: /home/bohdan-kucheriavyi/Documents/Repositories/Zapal/erp/data target: /home/zapal/frappe-bench bind: create_host_path: true @@ -242,6 +187,8 @@ networks: volumes: db-data: name: erp_db-data + erp-bench: + name: erp_erp-bench redis-cache-data: name: erp_redis-cache-data redis-queue-data: @@ -252,9 +199,7 @@ x-backend-defaults: condition: service_completed_successfully image: ghcr.io/zapal-tech/erp:latest volumes: - - ./data/sites:/home/zapal/frappe-bench/sites - - ./data/sites-assets:/home/zapal/frappe-bench/sites/assets - - ./data/logs:/home/zapal/frappe-bench/logs + - erp-bench:/home/zapal/frappe-bench 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 ea3d3c06..5ac3cd51 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -131,8 +131,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 rm -fr FROM base as erp @@ -144,11 +143,7 @@ COPY /usr/local/bin/nginx-entrypoint.sh /usr/local/bin/nginx-entrypoint.sh WORKDIR /home/zapal/frappe-bench -VOLUME [ \ - "/home/zapal/frappe-bench/sites", \ - "/home/zapal/frappe-bench/sites/assets", \ - "/home/zapal/frappe-bench/logs" \ -] +VOLUME ["/home/zapal/frappe-bench"] CMD [ \ "/home/zapal/frappe-bench/env/bin/gunicorn", \ diff --git a/images/production/Containerfile b/images/production/Containerfile index 3fc2a496..4896ba8b 100644 --- a/images/production/Containerfile +++ b/images/production/Containerfile @@ -125,8 +125,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 rm -fr FROM base as erp @@ -136,11 +135,7 @@ COPY --from=builder --chown=zapal:zapal /home/zapal/frappe-bench /home/zapal/fra WORKDIR /home/zapal/frappe-bench -VOLUME [ \ - "/home/zapal/frappe-bench/sites", \ - "/home/zapal/frappe-bench/sites/assets", \ - "/home/zapal/frappe-bench/logs" \ -] +VOLUME ["/home/zapal/frappe-bench"] CMD [ \ "/home/zapal/frappe-bench/env/bin/gunicorn", \