How we could restart the erpnext docker containers

I have completed my 3 sites up running using erpnext docker on vps production server.

but when I am trying to

docker compose --project-name erpnext-two exec backend bench restart

WARN: restart failed: Couldn’t find supervisorctl in PATH

How to issue commands inside the docker erpnext docker container , most of it I use
supervisorctrl restart all
bench --site site1.example.com migrate

Thanks

@treeem You would just restart the containers:
docker compose --project-name erpnext-two down
docker compose --project-name erpnext-two up -d

docker compose --project-name erpnext-two exec -u root backend bench get-app payments

Getting payments
$ git clone GitHub - frappe/payments: A payments app for frappe --branch develop --origin upstream
Cloning into ‘payments’…
remote: Enumerating objects: 1619, done.
remote: Counting objects: 100% (478/478), done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 1619 (delta 352), reused 386 (delta 314), pack-reused 1141
Receiving objects: 100% (1619/1619), 298.39 KiB | 3.08 MiB/s, done.
Resolving deltas: 100% (853/853), done.
Ignoring dependencies of payments. To install dependencies use --resolve-deps
Installing payments
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/payments
$ bench build --app payments
:heavy_check_mark: Application Assets Linked

yarn run v1.22.19
$ node esbuild --production --apps payments --run-build-command
File Size

DONE Total Build Time: 525.521ms

Done in 1.25s.
$ supervisorctl restart frappe:
unix:///var/run/supervisor.sock no such file
WARN: restarting supervisor failed. Use bench restart to retry.

you cannot do bench build and bench get-app in production containers

No supervisor in frappe_docker containers Container Basics

Each container runs a process and restarting replacing it does the job

After I ran
docker compose --project-name erpnext-two exec backend bench build

then I check the site on browser , now it lose all the styling

I also try to clear bench clear-website-cache,

you cannot do that, copying the text from FAQ

How to install official or custom apps?

In case of production setup you need to build your custom image for installing apps. This repository only publishes frappe/erpnext image with no additional app. You CANNOT bench get-app in running containers.

To build image refer documentation to build custom apps. To automate it using CI refer this post.

In case of development setup, you can do bench get-app as usual.

How to build assets?

You cannot build assets using bench build in running production containers. It will mess up the attached assets volume for the container in which the command was executed. It will cause problems in serving static assets. The asset building process is done during the image build. Images come pre-packaged with built assets and there is no need to build assets in production environment.

1 Like