frappe_docker icon indicating copy to clipboard operation
frappe_docker copied to clipboard

I followed the instructions to add custom apps and hrms was not installed

Open joscasjac opened this issue 1 year ago • 9 comments

Description of the issue

I followed the instructions to build an image with custom apps in the reppo under docs/custom-apps.md

Steps to reproduce the issue

  1. I created an apps.json file:
[
  
  {
    "url": "https://github.com/frappe/erpnext",
    "branch": "version-15"
  },{
    "url": "https://github.com/frappe/hrms",
    "branch": "version-15"
  }
 ]

  1. I ran:

export APPS_JSON_BASE64=$(base64 -w 0 apps.json)

  1. I ran:
docker build \
  --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
  --build-arg=FRAPPE_BRANCH=version-15 \
  --build-arg=PYTHON_VERSION=3.11.6 \
  --build-arg=NODE_VERSION=18.18.2 \
  --build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
  --tag=joscasjac/erpnexthr:15.5.0 \
  --file=images/custom/Containerfile .
  1. I updated my frappe-compose.yml to have the new image:
x-customizable-image: &customizable_image
  image: joscasjac/erpnexthr:15.5.0
  pull_policy: never

My complete frappe-compose.yml

name: frappe
x-customizable-image: &customizable_image
  image: joscasjac/erpnexthr:15.5.0
  pull_policy: never

services:
  backend:
    depends_on:
      configurator:
        condition: service_completed_successfully
        required: true
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  configurator:
    command:
    - |
      ls -1 apps > sites/apps.txt; bench set-config -g db_host $$DB_HOST; bench set-config -gp db_port $$DB_PORT; bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE"; bench set-config -gp socketio_port $$SOCKETIO_PORT;
    depends_on:
      db:
        condition: service_healthy
        required: true
      redis-cache:
        condition: service_started
        required: true
      redis-queue:
        condition: service_started
        required: true
    entrypoint:
    - bash
    - -c
    environment:
      DB_HOST: db
      DB_PORT: "3306"
      REDIS_CACHE: redis-cache:6379
      REDIS_QUEUE: redis-queue:6379
      SOCKETIO_PORT: "9000"
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  db:
    command:
    - --character-set-server=utf8mb4
    - --collation-server=utf8mb4_unicode_ci
    - --skip-character-set-client-handshake
    - --skip-innodb-read-only-compressed
    environment:
      MYSQL_ROOT_PASSWORD: pass
    healthcheck:
      test:
      - CMD-SHELL
      - mysqladmin ping -h localhost --password=pass
      interval: 1s
      retries: 15
    image: mariadb:10.6
    networks:
      default: null
    volumes:
    - type: volume
      source: db-data
      target: /var/lib/mysql
      volume: {}
  frontend:
    command:
    - nginx-entrypoint.sh
    depends_on:
      backend:
        condition: service_started
        required: true
      websocket:
        condition: service_started
        required: true
    environment:
      BACKEND: backend:8000
      CLIENT_MAX_BODY_SIZE: 50m
      FRAPPE_SITE_NAME_HEADER: $$host
      PROXY_READ_TIMOUT: "120"
      SOCKETIO: websocket:9000
      UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
      UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
      UPSTREAM_REAL_IP_RECURSIVE: "off"
    <<: *customizable_image
    labels:
      traefik.enable: "true"
      traefik.http.routers.frontend-http.entrypoints: websecure
      traefik.http.routers.frontend-http.rule: Host(`erp.goldengroup.com.gt`)
      traefik.http.routers.frontend-http.tls.certresolver: main-resolver
      traefik.http.services.frontend.loadbalancer.server.port: "8080"
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  proxy:
    command:
    - --providers.docker=true
    - --providers.docker.exposedbydefault=false
    - --entrypoints.web.address=:80
    - --entrypoints.web.http.redirections.entrypoint.to=websecure
    - --entrypoints.web.http.redirections.entrypoint.scheme=https
    - --entrypoints.websecure.address=:443
    - --certificatesResolvers.main-resolver.acme.httpChallenge=true
    - --certificatesResolvers.main-resolver.acme.httpChallenge.entrypoint=web
    - --certificatesResolvers.main-resolver.acme.email=admin@goldengroup.com.gt
    - --certificatesResolvers.main-resolver.acme.storage=/letsencrypt/acme.json
    image: traefik:2.5
    networks:
      default: null
    ports:
    - mode: ingress
      target: 80
      published: "80"
      protocol: tcp
    - mode: ingress
      target: 443
      published: "443"
      protocol: tcp
    volumes:
    - type: volume
      source: cert-data
      target: /letsencrypt
      volume: {}
    - type: bind
      source: /var/run/docker.sock
      target: /var/run/docker.sock
      read_only: true
      bind:
        create_host_path: true
  queue-long:
    command:
    - bench
    - worker
    - --queue
    - long,default,short
    depends_on:
      configurator:
        condition: service_completed_successfully
        required: true
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  queue-short:
    command:
    - bench
    - worker
    - --queue
    - short,default
    depends_on:
      configurator:
        condition: service_completed_successfully
        required: true
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  redis-cache:
    image: redis:6.2-alpine
    networks:
      default: null
    volumes:
    - type: volume
      source: redis-cache-data
      target: /data
      volume: {}
  redis-queue:
    image: redis:6.2-alpine
    networks:
      default: null
    volumes:
    - type: volume
      source: redis-queue-data
      target: /data
      volume: {}
  scheduler:
    command:
    - bench
    - schedule
    depends_on:
      configurator:
        condition: service_completed_successfully
        required: true
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
  websocket:
    command:
    - node
    - /home/frappe/frappe-bench/apps/frappe/socketio.js
    depends_on:
      configurator:
        condition: service_completed_successfully
        required: true
    <<: *customizable_image
    networks:
      default: null
    volumes:
    - type: volume
      source: sites
      target: /home/frappe/frappe-bench/sites
      volume: {}
networks:
  default:
    name: frappe_default
volumes:
  cert-data:
    name: frappe_cert-data
  db-data:
    name: frappe_db-data
  redis-cache-data:
    name: frappe_redis-cache-data
  redis-queue-data:
    name: frappe_redis-queue-data
  sites:
    name: frappe_sites
x-backend-defaults:
  depends_on:
    configurator:
      condition: service_completed_successfully
  <<: *customizable_image
  volumes:
  - sites:/home/frappe/frappe-bench/sites
x-depends-on-configurator:
  depends_on:
    configurator:
      condition: service_completed_successfully

Observed result

Everything ran without any errors but no hrms in the app

Expected result

To have the HRMS module in my erpnext instance

joscasjac avatar Dec 19 '23 18:12 joscasjac

Did you install app on the site? You need to install it with --install-app=erpnext --install-app=hrms during site creation.

https://github.com/frappe/frappe_docker/blob/main/docs/site-operations.md#setup-new-site

revant avatar Dec 21 '23 05:12 revant

No, I used the easy-install script in the bench docs, perhaps adding the option to install all the apps in the script, also would be helpful to reference that you have to do that in the custom apps documentation.

Thanks for the help!

joscasjac avatar Dec 26 '23 19:12 joscasjac

Confirmed, We have the same issue, while trying to add education app. Custom image was built successfully, docker container created, but the additional app was not appear.

Any help would be appreciated. Thanks!

tikmku avatar Dec 28 '23 04:12 tikmku

I use "sudo docker compose -f compose.yaml up -d" to setup the docker. Then How can I install some app after that?

I use "sudo docker exec -it f9412e763e8e /bin/bash" to install apps,but I will not work . WARN: restart failed: Couldn't find supervisorctl in PATH

athmoon avatar Jan 02 '24 12:01 athmoon

I am definitely finding the docs to be nearly useless here. There are so many issues and forum threads asking the same questions, which speaks to the fact that the installation process and its documentation are both very poor, and the latter often contradictory.

Although the installation experience really should be improved, in the very least, there should be end-to-end documentation for installation that can be followed cold. So far, I've come across a few dozen undocumented steps which I only know due to my own IT and Docker experience.

CodeMouse92 avatar Jan 12 '24 22:01 CodeMouse92

@CodeMouse92 please be professional This is open source, if you want something great then pay for it. If you don't, Can you please say something to motivate the maintainers instead of saying thing like "useless" ????

hieutrluu avatar Jan 17 '24 14:01 hieutrluu

Documentation is crucial. No project is production-grade without it. I do a lot of "for free" open source work myself, so I'm not numb to that. I've also defended maintainers historically. But the truth is, the documentation itself here is actually, objectively useless. It is not unprofessional to report that fact, any more than it would be to report that a button doesn't work or that there's a security bug. So, I professionally stand by my extremely impersonal report of a very real issue.

I also happen to have a higher opinion of the maintainers than you seem to; I doubt they're so brittle as to take offense at my reporting what I did. Professional software engineers do not need constant motivational quips to enable them to care about their project's usability or their users. That's not to say that positive statements do not have a place, but a significant issue is best approached in a straightforward manner. (If you doubt me, just read any average bug report or code review from one professional developer to another. They're very to-the-point.)

And P.S. I'm trying to use this for an unincorporated non-profit training program I fund out of my very limited pocket, so I couldn't pay for it no matter how much I want to. But that's not the point. I'm not asking for features, bug fixes, support, but merely that the most elementary documentation -- installation itself -- be viable. Anything less is like being content with software that doesn't launch at all.

CodeMouse92 avatar Jan 17 '24 14:01 CodeMouse92

Hi everyone. My two cents:

I was having the very same problem. I'm suspecting it was in some way related to Docker's caches, as it worked fine after I performed a complete Docker clean up of the caches and volumes. If you try this, be mindful of taking a complete backup outside the machine prior doing this as the sites volume will be erased too.

My way of checking if the right custom image is being deployed is issuing bench version inside the _backend container. All the custom apps should be reported there.

If not, then it is wise to re-check that the custom image is being correctly labeled on the system according to: https://github.com/frappe/frappe_docker/blob/main/docs/custom-apps.md#use-images

ie: @joscasjac used this when building the custom image:

--tag=joscasjac/erpnexthr:15.5.0

which is correctly identified in his compose file:

x-customizable-image: &customizable_image
  image: joscasjac/erpnexthr:15.5.0
  pull_policy: never

maovidal avatar Jan 23 '24 00:01 maovidal

This issue has been automatically marked as stale. You have a week to explain why you believe this is an error.

github-actions[bot] avatar Mar 24 '24 00:03 github-actions[bot]