Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.48 KB | None | 0 0
  1. version: "3"
  2.  
  3. services:
  4. backend:
  5. image: frappe/erpnext:v15
  6. platform: linux/amd64
  7. deploy:
  8. restart_policy:
  9. condition: on-failure
  10. volumes:
  11. - sites:/home/frappe/frappe-bench/sites
  12. - logs:/home/frappe/frappe-bench/logs
  13. networks:
  14. - web
  15.  
  16. configurator:
  17. image: frappe/erpnext:v15
  18. platform: linux/amd64
  19. deploy:
  20. restart_policy:
  21. condition: none
  22. entrypoint:
  23. - bash
  24. - -c
  25. command:
  26. - >
  27. ls -1 apps > sites/apps.txt;
  28. bench set-config -g db_host $$DB_HOST;
  29. bench set-config -gp db_port $$DB_PORT;
  30. bench set-config -g redis_cache "redis://$$REDIS_CACHE";
  31. bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
  32. bench set-config -gp socketio_port $$SOCKETIO_PORT;
  33. bench set-config -gp background_workers 10;
  34. bench set-config -g host_name "http://127.0.0.1"
  35. bench set-config -g developer_mode 0
  36. environment:
  37. DB_HOST: $DB_HOST
  38. DB_PORT: "3306"
  39. REDIS_CACHE: $REDIS_CACHE:6379
  40. REDIS_QUEUE: $REDIS_QUEUE:6379
  41. SOCKETIO_PORT: "9000"
  42. volumes:
  43. - sites:/home/frappe/frappe-bench/sites
  44. - logs:/home/frappe/frappe-bench/logs
  45. networks:
  46. - web
  47.  
  48. create-site:
  49. image: frappe/erpnext:v15
  50. platform: linux/amd64
  51. deploy:
  52. restart_policy:
  53. condition: none
  54. volumes:
  55. - sites:/home/frappe/frappe-bench/sites
  56. - logs:/home/frappe/frappe-bench/logs
  57. entrypoint:
  58. - bash
  59. - -c
  60. command:
  61. - >
  62. wait-for-it -t 120 db:3306;
  63. wait-for-it -t 120 redis-cache:6379;
  64. wait-for-it -t 120 redis-queue:6379;
  65. export start=`date +%s`;
  66. until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
  67. [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
  68. [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]];
  69. do
  70. echo "Waiting for sites/common_site_config.json to be created";
  71. sleep 5;
  72. if (( `date +%s`-start > 120 )); then
  73. echo "could not find sites/common_site_config.json with required keys";
  74. exit 1
  75. fi
  76. done;
  77. echo "sites/common_site_config.json found";
  78. bench new-site --no-mariadb-socket --admin-password=$ADMIN_PASSWORD --db-root-password=$DB_PASSWORD --install-app erpnext --set-default frontend;
  79.  
  80.  
  81. networks:
  82. - web
  83.  
  84. db:
  85. image: mariadb:10.6
  86. healthcheck:
  87. test: mysqladmin ping -h erpnext-db --password=$DB_PASSWORD
  88. interval: 1s
  89. retries: 15
  90. deploy:
  91. restart_policy:
  92. condition: on-failure
  93. command:
  94. - --character-set-server=utf8mb4
  95. - --collation-server=utf8mb4_unicode_ci
  96. - --skip-character-set-client-handshake
  97. - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
  98. hostname: erpnext-db
  99. environment:
  100. MARIADB_HOST: $DB_HOST
  101. MARIADB_ROOT_PASSWORD: $DB_PASSWORD
  102. volumes:
  103. - db-data:/var/lib/mysql
  104. networks:
  105. - web
  106.  
  107. frontend:
  108. image: frappe/erpnext:v15
  109. platform: linux/amd64
  110. deploy:
  111. restart_policy:
  112. condition: on-failure
  113. command:
  114. - nginx-entrypoint.sh
  115. environment:
  116. BACKEND: backend:8000
  117. FRAPPE_SITE_NAME_HEADER: frontend
  118. SOCKETIO: websocket:9000
  119. UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
  120. UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
  121. UPSTREAM_REAL_IP_RECURSIVE: "off"
  122. PROXY_READ_TIMEOUT: 600
  123. CLIENT_MAX_BODY_SIZE: 50m
  124. volumes:
  125. - sites:/home/frappe/frappe-bench/sites
  126. - logs:/home/frappe/frappe-bench/logs
  127. labels:
  128. - "traefik.enable=true"
  129. - "traefik.http.routers.erp.entrypoints=websecure"
  130. - "traefik.http.routers.erp.rule=Host(`erp.domain`)"
  131. - "traefik.http.routers.erp.tls=true"
  132. - "traefik.http.routers.erp.tls.certresolver=lets-encrypt"
  133. - "traefik.http.routers.erp.service=erp"
  134. - "traefik.http.services.erp.loadbalancer.server.port=8080"
  135. - "traefik.docker.network=web"
  136. networks:
  137. - web
  138.  
  139. queue-long:
  140. image: frappe/erpnext:v15
  141. platform: linux/amd64
  142. deploy:
  143. restart_policy:
  144. condition: on-failure
  145. command:
  146. - bench
  147. - worker
  148. - --queue
  149. - long
  150. volumes:
  151. - sites:/home/frappe/frappe-bench/sites
  152. - logs:/home/frappe/frappe-bench/logs
  153. networks:
  154. - web
  155.  
  156. queue-short:
  157. image: frappe/erpnext:v15
  158. platform: linux/amd64
  159. deploy:
  160. restart_policy:
  161. condition: on-failure
  162. command:
  163. - bench
  164. - worker
  165. - --queue
  166. - short
  167. volumes:
  168. - sites:/home/frappe/frappe-bench/sites
  169. - logs:/home/frappe/frappe-bench/logs
  170. networks:
  171. - web
  172.  
  173. queue-default:
  174. image: frappe/erpnext:v15
  175. platform: linux/amd64
  176. deploy:
  177. restart_policy:
  178. condition: on-failure
  179. command:
  180. - bench
  181. - worker
  182. - --queue
  183. - default
  184. volumes:
  185. - sites:/home/frappe/frappe-bench/sites
  186. - logs:/home/frappe/frappe-bench/logs
  187. networks:
  188. - web
  189.  
  190. redis-queue:
  191. image: redis:6.2-alpine
  192. container_name: "erpnext-redis-queue"
  193. deploy:
  194. restart_policy:
  195. condition: on-failure
  196. volumes:
  197. - redis-queue-data:/data
  198. networks:
  199. - web
  200.  
  201. redis-cache:
  202. image: redis:6.2-alpine
  203. container_name: "erpnext-redis-cache"
  204. deploy:
  205. restart_policy:
  206. condition: on-failure
  207. volumes:
  208. - redis-cache-data:/data
  209. networks:
  210. - web
  211.  
  212. scheduler:
  213. image: frappe/erpnext:v15
  214. platform: linux/amd64
  215. deploy:
  216. restart_policy:
  217. condition: on-failure
  218. command:
  219. - bench
  220. - schedule
  221. volumes:
  222. - sites:/home/frappe/frappe-bench/sites
  223. - logs:/home/frappe/frappe-bench/logs
  224. networks:
  225. - web
  226.  
  227. websocket:
  228. image: frappe/erpnext:v15
  229. platform: linux/amd64
  230. deploy:
  231. restart_policy:
  232. condition: on-failure
  233. command:
  234. - node
  235. - /home/frappe/frappe-bench/apps/frappe/socketio.js
  236. volumes:
  237. - sites:/home/frappe/frappe-bench/sites
  238. - logs:/home/frappe/frappe-bench/logs
  239.  
  240. networks:
  241. - web
  242.  
  243. volumes:
  244. db-data:
  245. redis-queue-data:
  246. redis-cache-data:
  247. sites:
  248. logs:
  249.  
  250. networks:
  251. web:
  252. external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement