Skip to content

Commit 4c7dca7

Browse files
committed
feat: update erpnext and kafka configs
1 parent c4a9cd3 commit 4c7dca7

21 files changed

Lines changed: 343 additions & 251 deletions

apps/erpnext/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
W9_REPO=frappe/erpnext
22
W9_DIST=community
3-
W9_VERSION=v15.34.1
3+
W9_VERSION=v16.7.3
4+
W9_HRMS_BRANCH=version-16
45

56
W9_ID=erpnext
67
W9_POWER_PASSWORD=1PrMxExC45LsCT

apps/erpnext/CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# CHANGELOG
1+
# Changelog
22

3-
## Release
4-
### Fixes and Enhancements
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog, and this project follows Semantic Versioning.
6+
7+
## [16.0.0] - 2026-03-12
8+
9+
### Changed
10+
11+
- Upgraded ERPNext to v16.
12+
13+
### Added
14+
15+
- Added the HR module introduced in ERPNext v16.
516

apps/erpnext/Notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ password: admin
4747
这是怎么回事呢?通过官方的论坛中研究,发现这是文档更新不及时导致,也就是说overrides中的安装在文档中还没有体现,虽然它更具有效率。
4848

4949

50+
### 安装完成后执行命令,同步hrms资源,解决图片不显示
51+
```
52+
docker compose exec frontend bash -lc 'set -euxo pipefail; cd /home/frappe/frappe-bench; id; ls -ld apps/hrms/hrms/public; mkdir -p sites/assets/hrms; cp -a apps/hrms/hrms/public/. sites/assets/hrms/; ls -lah sites/assets/hrms; ls -lah sites/assets/hrms/images/frappe-hr-logo.svg'
53+
```
54+
5055
#### 与URL有关的变量有那些?
5156

5257
```

apps/erpnext/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is an **[Docker Compose template](https://github.com/Websoft9/docker-library)** powered by [Websoft9](https://www.websoft9.com) based on Docker for ERPNext:
44

55

6-
- community: v15, v14, v13
6+
- community: v16, v15, v14
77

88

99
## System Requirements

apps/erpnext/docker-compose.yml

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
# new image: https://hub.docker.com/r/frappe/erpnext/tags
33
# docs: https://github.com/frappe/frappe_docker/blob/main/pwd.yml
44

5-
version: '3.8'
6-
75
services:
86
backend:
97
image: $W9_REPO:$W9_VERSION
108
container_name: $W9_ID-backend
9+
depends_on:
10+
create-site:
11+
condition: service_completed_successfully
1112
restart: unless-stopped
1213
volumes:
14+
- apps:/home/frappe/frappe-bench/apps
15+
- env:/home/frappe/frappe-bench/env
1316
- sites:/home/frappe/frappe-bench/sites
1417
- logs:/home/frappe/frappe-bench/logs
1518

@@ -23,20 +26,16 @@ services:
2326
# add redis_socketio for backward compatibility
2427
command:
2528
- >
26-
ls -1 apps > sites/apps.txt;
27-
bench set-config -g db_host $$DB_HOST;
28-
bench set-config -gp db_port $$DB_PORT;
29-
bench set-config -g redis_cache "redis://$$REDIS_CACHE";
30-
bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
31-
bench set-config -g redis_socketio "redis://$$REDIS_QUEUE";
32-
bench set-config -gp socketio_port $$SOCKETIO_PORT;
29+
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;
3330
environment:
3431
DB_HOST: $W9_ID-mariadb
3532
DB_PORT: "3306"
3633
REDIS_CACHE: $W9_ID-redis-cache:6379
3734
REDIS_QUEUE: $W9_ID-redis-queue:6379
3835
SOCKETIO_PORT: "9000"
3936
volumes:
37+
- apps:/home/frappe/frappe-bench/apps
38+
- env:/home/frappe/frappe-bench/env
4039
- sites:/home/frappe/frappe-bench/sites
4140
- logs:/home/frappe/frappe-bench/logs
4241

@@ -45,18 +44,16 @@ services:
4544
container_name: $W9_ID-create-site
4645
restart: none
4746
volumes:
47+
- apps:/home/frappe/frappe-bench/apps
48+
- env:/home/frappe/frappe-bench/env
4849
- sites:/home/frappe/frappe-bench/sites
4950
- logs:/home/frappe/frappe-bench/logs
5051
entrypoint:
5152
- bash
5253
- -c
5354
command:
5455
- >
55-
wait-for-it -t 120 $W9_ID-mariadb:3306;
56-
wait-for-it -t 120 $W9_ID-redis-cache:6379;
57-
wait-for-it -t 120 $W9_ID-redis-queue:6379;
58-
export start=`date +%s`;
59-
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
56+
set -e; wait-for-it -t 120 $W9_ID-mariadb:3306; wait-for-it -t 120 $W9_ID-redis-cache:6379; wait-for-it -t 120 $W9_ID-redis-queue:6379; export start=`date +%s`; until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
6057
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
6158
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]];
6259
do
@@ -66,9 +63,24 @@ services:
6663
echo "could not find sites/common_site_config.json with required keys";
6764
exit 1
6865
fi
69-
done;
70-
echo "sites/common_site_config.json found";
71-
bench new-site --no-mariadb-socket --admin-password=$W9_LOGIN_PASSWORD --db-root-password=$W9_LOGIN_PASSWORD --install-app erpnext --set-default frontend;
66+
done; echo "sites/common_site_config.json found"; if [ ! -d sites/frontend ]; then
67+
bench new-site --mariadb-user-host-login-scope='%' --admin-password=$W9_LOGIN_PASSWORD --db-root-username=root --db-root-password=$W9_LOGIN_PASSWORD --install-app erpnext --set-default frontend;
68+
else
69+
echo "Site frontend already exists, skip new-site";
70+
fi; if [ ! -d apps/hrms ]; then
71+
bench get-app --branch $W9_HRMS_BRANCH hrms;
72+
fi; bench pip install -e apps/hrms; ls -1 apps > sites/apps.txt; if ! bench --site frontend list-apps | grep -qx hrms; then
73+
bench --site frontend install-app hrms;
74+
else
75+
echo "HRMS already installed on frontend";
76+
fi; mkdir -p sites/assets; rm -rf sites/assets/hrms; cp -a /home/frappe/frappe-bench/apps/hrms/hrms/public sites/assets/hrms; if command -v node >/dev/null 2>&1; then
77+
bench build --app hrms;
78+
else
79+
echo "node not found, skip bench build --app hrms";
80+
fi; if [ ! -f sites/assets/hrms/images/frappe-hr-logo.svg ]; then
81+
echo "ERROR: HRMS asset missing after build: sites/assets/hrms/images/frappe-hr-logo.svg";
82+
exit 1;
83+
fi; bench --site frontend migrate; bench --site frontend clear-cache; bench --site frontend clear-website-cache;
7284
7385
mariadb:
7486
image: mariadb:$W9_DB_VERSION
@@ -92,9 +104,12 @@ services:
92104
image: $W9_REPO:$W9_VERSION
93105
container_name: $W9_ID
94106
depends_on:
95-
- websocket
107+
create-site:
108+
condition: service_completed_successfully
109+
websocket:
110+
condition: service_started
96111
restart: unless-stopped
97-
env_file:
112+
env_file:
98113
- .env
99114
command:
100115
- nginx-entrypoint.sh
@@ -108,6 +123,8 @@ services:
108123
PROXY_READ_TIMEOUT: 120
109124
CLIENT_MAX_BODY_SIZE: 50m
110125
volumes:
126+
- apps:/home/frappe/frappe-bench/apps
127+
- env:/home/frappe/frappe-bench/env
111128
- sites:/home/frappe/frappe-bench/sites
112129
- logs:/home/frappe/frappe-bench/logs
113130
ports:
@@ -116,26 +133,36 @@ services:
116133
queue-long:
117134
image: $W9_REPO:$W9_VERSION
118135
container_name: $W9_ID-queue-long
136+
depends_on:
137+
create-site:
138+
condition: service_completed_successfully
119139
restart: unless-stopped
120140
command:
121141
- bench
122142
- worker
123143
- --queue
124144
- long,default,short
125145
volumes:
146+
- apps:/home/frappe/frappe-bench/apps
147+
- env:/home/frappe/frappe-bench/env
126148
- sites:/home/frappe/frappe-bench/sites
127149
- logs:/home/frappe/frappe-bench/logs
128150

129151
queue-short:
130152
image: $W9_REPO:$W9_VERSION
131153
container_name: $W9_ID-queue-short
154+
depends_on:
155+
create-site:
156+
condition: service_completed_successfully
132157
restart: unless-stopped
133158
command:
134159
- bench
135160
- worker
136161
- --queue
137162
- short,default
138163
volumes:
164+
- apps:/home/frappe/frappe-bench/apps
165+
- env:/home/frappe/frappe-bench/env
139166
- sites:/home/frappe/frappe-bench/sites
140167
- logs:/home/frappe/frappe-bench/logs
141168

@@ -156,32 +183,45 @@ services:
156183
scheduler:
157184
image: $W9_REPO:$W9_VERSION
158185
container_name: $W9_ID-scheduler
186+
depends_on:
187+
create-site:
188+
condition: service_completed_successfully
159189
restart: unless-stopped
160190
command:
161191
- bench
162192
- schedule
163193
volumes:
194+
- apps:/home/frappe/frappe-bench/apps
195+
- env:/home/frappe/frappe-bench/env
164196
- sites:/home/frappe/frappe-bench/sites
165197
- logs:/home/frappe/frappe-bench/logs
166198

167199
websocket:
168200
image: $W9_REPO:$W9_VERSION
169201
container_name: $W9_ID-websocket
202+
depends_on:
203+
create-site:
204+
condition: service_completed_successfully
170205
restart: unless-stopped
171206
command:
172207
- node
173208
- /home/frappe/frappe-bench/apps/frappe/socketio.js
174209
volumes:
210+
- apps:/home/frappe/frappe-bench/apps
211+
- env:/home/frappe/frappe-bench/env
175212
- sites:/home/frappe/frappe-bench/sites
176213
- logs:/home/frappe/frappe-bench/logs
177214

178215
volumes:
216+
apps:
217+
env:
179218
db-data:
180219
redis-queue-data:
181220
redis-cache-data:
182221
sites:
183222
logs:
184223

224+
185225
networks:
186226
default:
187227
name: $W9_NETWORK

apps/erpnext/src/after_up.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

apps/erpnext/src/compose.yaml

100644100755
Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
x-depends-on-configurator: &depends_on_configurator
2-
depends_on:
3-
configurator:
4-
condition: service_completed_successfully
5-
6-
x-backend-defaults: &backend_defaults
7-
<<: *depends_on_configurator
8-
image: frappe/frappe-worker:${FRAPPE_VERSION:?No Frappe version set}
9-
volumes:
10-
- sites:/home/frappe/frappe-bench/sites
11-
12-
services:
13-
configurator:
14-
<<: *backend_defaults
15-
command: configure.py
16-
environment:
17-
DB_HOST: ${DB_HOST}
18-
DB_PORT: ${DB_PORT}
19-
REDIS_CACHE: ${REDIS_CACHE}
20-
REDIS_QUEUE: ${REDIS_QUEUE}
21-
REDIS_SOCKETIO: ${REDIS_SOCKETIO}
22-
SOCKETIO_PORT: 9000
23-
depends_on: {}
24-
25-
backend:
26-
<<: *backend_defaults
27-
volumes:
28-
- sites:/home/frappe/frappe-bench/sites
29-
- assets:/home/frappe/frappe-bench/sites/assets:ro
30-
31-
frontend:
32-
image: frappe/frappe-nginx:${FRAPPE_VERSION}
33-
environment:
34-
BACKEND: backend:8000
35-
SOCKETIO: websocket:9000
36-
FRAPPE_SITE_NAME_HEADER: ${FRAPPE_SITE_NAME_HEADER:-$$host}
37-
UPSTREAM_REAL_IP_ADDRESS: ${UPSTREAM_REAL_IP_ADDRESS:-127.0.0.1}
38-
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
39-
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
40-
volumes:
41-
- sites:/usr/share/nginx/html/sites
42-
- assets:/usr/share/nginx/html/assets
43-
depends_on:
44-
- backend
45-
- websocket
46-
47-
websocket:
48-
<<: *depends_on_configurator
49-
image: frappe/frappe-socketio:${FRAPPE_VERSION}
50-
volumes:
51-
- sites:/home/frappe/frappe-bench/sites
52-
53-
queue-short:
54-
<<: *backend_defaults
55-
command: bench worker --queue short
56-
57-
queue-default:
58-
<<: *backend_defaults
59-
command: bench worker --queue default
60-
61-
queue-long:
62-
<<: *backend_defaults
63-
command: bench worker --queue long
64-
65-
scheduler:
66-
<<: *backend_defaults
67-
command: bench schedule
68-
69-
# ERPNext requires local assets access (Frappe does not)
70-
volumes:
71-
sites:
72-
assets:
1+
x-depends-on-configurator: &depends_on_configurator
2+
depends_on:
3+
configurator:
4+
condition: service_completed_successfully
5+
6+
x-backend-defaults: &backend_defaults
7+
<<: *depends_on_configurator
8+
image: frappe/frappe-worker:${FRAPPE_VERSION:?No Frappe version set}
9+
volumes:
10+
- sites:/home/frappe/frappe-bench/sites
11+
12+
services:
13+
configurator:
14+
<<: *backend_defaults
15+
command: configure.py
16+
environment:
17+
DB_HOST: ${DB_HOST}
18+
DB_PORT: ${DB_PORT}
19+
REDIS_CACHE: ${REDIS_CACHE}
20+
REDIS_QUEUE: ${REDIS_QUEUE}
21+
REDIS_SOCKETIO: ${REDIS_SOCKETIO}
22+
SOCKETIO_PORT: 9000
23+
depends_on: {}
24+
25+
backend:
26+
<<: *backend_defaults
27+
volumes:
28+
- sites:/home/frappe/frappe-bench/sites
29+
- assets:/home/frappe/frappe-bench/sites/assets:ro
30+
31+
frontend:
32+
image: frappe/frappe-nginx:${FRAPPE_VERSION}
33+
environment:
34+
BACKEND: backend:8000
35+
SOCKETIO: websocket:9000
36+
FRAPPE_SITE_NAME_HEADER: ${FRAPPE_SITE_NAME_HEADER:-$$host}
37+
UPSTREAM_REAL_IP_ADDRESS: ${UPSTREAM_REAL_IP_ADDRESS:-127.0.0.1}
38+
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
39+
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
40+
volumes:
41+
- sites:/usr/share/nginx/html/sites
42+
- assets:/usr/share/nginx/html/assets
43+
depends_on:
44+
- backend
45+
- websocket
46+
47+
websocket:
48+
<<: *depends_on_configurator
49+
image: frappe/frappe-socketio:${FRAPPE_VERSION}
50+
volumes:
51+
- sites:/home/frappe/frappe-bench/sites
52+
53+
queue-short:
54+
<<: *backend_defaults
55+
command: bench worker --queue short
56+
57+
queue-default:
58+
<<: *backend_defaults
59+
command: bench worker --queue default
60+
61+
queue-long:
62+
<<: *backend_defaults
63+
command: bench worker --queue long
64+
65+
scheduler:
66+
<<: *backend_defaults
67+
command: bench schedule
68+
69+
# ERPNext requires local assets access (Frappe does not)
70+
volumes:
71+
sites:
72+
assets:

0 commit comments

Comments
 (0)