Install custom apps for Docker installation

Currently we are trying to move from a self-hosted VM solution to a self-hosted Docker solution. As far as possible, I tried to follow the steps described on Github.

and

https://github.com/frappe/frappe_docker/blob/main/docs/single-bench.md

I performed:

git clone https://github.com/frappe/frappe_docker.git
cd frappe_docker

I created an .env file based on the env-local file and modified it to the following:

LETSENCRYPT_EMAIL=email@example.com
ERPNEXT_VERSION=version-12
FRAPPE_VERSION=version-12
MARIADB_HOST=mariadb
MYSQL_ROOT_PASSWORD=9GOxGgRD0o8CjV6zDOwp
SITE_NAME=erpnext-nginx
SITES=`erpnext-nginx`
DB_ROOT_USER=root
ADMIN_PASSWORD=AdminErpNext
INSTALL_APPS=erpnext
ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=web
CERT_RESOLVER_LABEL=erpnext.local.no-cert-resolver
HTTPS_REDIRECT_RULE_LABEL=erpnext.local.no-redirect-rule
HTTPS_REDIRECT_ENTRYPOINT_LABEL=erpnext.local.no-entrypoint
HTTPS_REDIRECT_MIDDLEWARE_LABEL=erpnext.local.no-middleware
HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=erpnext.local-no-redirect-middleware
SKIP_NGINX_TEMPLATE_GENERATION=0
WORKER_CLASS=gthread

I had to change the site_name to ā€˜erpnext_nginxā€™ to be able to access our server using an internal IP address (our server is for internal use only).

For the same reason I have added the following to the Docker compose file (How can I make erp available in LAN, deployed with docker? - #18 by revant_one):

- "traefik.http.routers.erpnext-nginx.rule=HostRegexp(`{catchall:.*}`)"
- "traefik.http.middlewares.erpnext-nginx.headers.customrequestheaders.Ho\
st=erpnext-nginx"
- "traefik.http.routers.erpnext-nginx.middlewares=erpnext-nginx"

Then I execute the following command

docker-compose --project-name erpnext up -d

And then the following command to check the progress:

docker logs erpnext_site-creator_1 -f

This works and when this is finished, Iā€™m able to access my brand-new ERP instance by browsing to our server IP.

Then I tried to install one of our custom apps called ā€˜Repairs and Supportā€™. What I did:

In the .env file change

INSTALL_APPS=erpnext

To

INSTALL_APPS=erpnext,repairs_and_support

When this is changed, I follow the steps described in https://github.com/frappe/frappe_docker/blob/main/docs/custom-apps-for-production.md until the sentence:

Open up ./installation/docker-compose-custom.yml and replace all instances of [app] with the name of your app.

Because we donā€™t have Git server or Github account, Iā€™ve copied our app sources to our server to: ā€˜/opt/erpnext_appsā€™. This path is also used in both Docker files

RUN /install_app repairs_and_support /opt/erpnext_apps/repairs_and_support

But unfortunately, I get an app not found error. Iā€™ve tried a lot, but without successā€¦ What am I doing wrong? Thanks in advance!

Attempt 1 to connect to mariadb:3306
Attempt 1 to connect to redis-queue:6379
Attempt 1 to connect to redis-cache:6379
Attempt 1 to connect to redis-socketio:6379
Connections OK
Created user _285132e2c34995ba
Created database _285132e2c34995ba
Granted privileges to user _285132e2c34995ba and database _285132e2c34995ba
Starting database import...
Imported from database /home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/framework_mariadb.sql

Installing frappe...
Updating DocTypes for frappe : [========================================]
Updating country info : [========================================]
Installing erpnext...
Updating DocTypes for erpnext : [========================================]
Updating customizations for Address
Could not find app "repairs_and_support"

we need to improve the documentation.

  • how to build images with custom app
  • how to manage private repos
  • troubleshooting

youā€™ll need to build your image.
Get GitHub or Gitlab account. they provide ci runners and container registry for free for open source projects.

2 Likes

Hi revant_one,

I agree with that. The documentation could be better. Do you think the problem is solved when I move our code to Github/Gitlab? Or is there something else I could try to debug the problem?
Is there also documention about how to build an image for a custom app?

Thanks in advance.

Check this frappe app: GitHub - revant/erpnext_feature_board: Feature board for ERPNext

  • it has single ā€œmainā€ branch
  • github workflows that build nginx and worker images.
  • images are pushed to private container registry, you need to push them to GitHub/Gitlab/Dockerhub registry
  • Whenever there is change in main branch, new ā€œlatestā€ images are built.
  • Add a github workflow on: tags that builds and pushes the tagged version to registry