update src

This commit is contained in:
chendelin1982 2022-05-30 23:45:30 +08:00
parent d9aebfe66e
commit dd370ac0ed
10 changed files with 1832 additions and 8 deletions

9
.env
View File

@ -1,3 +1,10 @@
APP_PORT=9001
APP_NAME=erpnext
DB_MARIA_PASSWORD=LFVKy9ra9Njy2E
# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md
FRAPPE_VERSION=v13.30.0
@ -5,7 +12,7 @@ FRAPPE_VERSION=v13.30.0
# Only with ERPNext override
ERPNEXT_VERSION=v13.31.1
DB_PASSWORD=123
DB_PASSWORD=$DB_MARIA_PASSWORD
# Only if you use external database
DB_HOST=

View File

@ -1,6 +1,5 @@
# ERPNext
<<<<<<< HEAD
## About Install
官方非常及时的更新了安装所需的镜像,且提供了灵活多变的 docker compose 文件以供用户使用。
@ -29,8 +28,15 @@ password: admin
#### ERPNext 镜像与 Frappe 镜像有什么区别?
有待研究,实验中发现 ERPNext 不会出现图片乱码问题
=======
* docs: https://github.com/frappe/frappe_docker
* versions: 11, 12, 13
>>>>>>> b56db58d7c833ed9f471f35d255895db33f81d5b
#### 与URL有关的变量有那些
```
echo "ROUTER=custom-one-example" > ~/gitops/custom-one-example.env
echo "SITES=\`custom-one.example.com\`" >> ~/gitops/custom-one-example.env
echo "BASE_SITE=one.example.com" >> ~/gitops/custom-one-example.env
echo "BENCH_NETWORK=erpnext-one" >> ~/gitops/custom-one-example.env
```
https://github.com/frappe/frappe_docker/blob/main/docs/single-server-example.md#create-custom-domain-to-existing-site

View File

@ -30,6 +30,7 @@ services:
frontend:
image: frappe/frappe-nginx:${FRAPPE_VERSION}
container_name: $APP_NAME
environment:
BACKEND: backend:8000
SOCKETIO: websocket:9000

72
src/compose.yaml Normal file
View File

@ -0,0 +1,72 @@
x-depends-on-configurator: &depends_on_configurator
depends_on:
configurator:
condition: service_completed_successfully
x-backend-defaults: &backend_defaults
<<: *depends_on_configurator
image: frappe/frappe-worker:${FRAPPE_VERSION:?No Frappe version set}
volumes:
- sites:/home/frappe/frappe-bench/sites
services:
configurator:
<<: *backend_defaults
command: configure.py
environment:
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
REDIS_CACHE: ${REDIS_CACHE}
REDIS_QUEUE: ${REDIS_QUEUE}
REDIS_SOCKETIO: ${REDIS_SOCKETIO}
SOCKETIO_PORT: 9000
depends_on: {}
backend:
<<: *backend_defaults
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets:ro
frontend:
image: frappe/frappe-nginx:${FRAPPE_VERSION}
environment:
BACKEND: backend:8000
SOCKETIO: websocket:9000
FRAPPE_SITE_NAME_HEADER: ${FRAPPE_SITE_NAME_HEADER:-$$host}
UPSTREAM_REAL_IP_ADDRESS: ${UPSTREAM_REAL_IP_ADDRESS:-127.0.0.1}
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
volumes:
- sites:/usr/share/nginx/html/sites
- assets:/usr/share/nginx/html/assets
depends_on:
- backend
- websocket
websocket:
<<: *depends_on_configurator
image: frappe/frappe-socketio:${FRAPPE_VERSION}
volumes:
- sites:/home/frappe/frappe-bench/sites
queue-short:
<<: *backend_defaults
command: bench worker --queue short
queue-default:
<<: *backend_defaults
command: bench worker --queue default
queue-long:
<<: *backend_defaults
command: bench worker --queue long
scheduler:
<<: *backend_defaults
command: bench schedule
# ERPNext requires local assets access (Frappe does not)
volumes:
sites:
assets:

1665
src/example.env Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,4 @@
docker-compose.yml
installation
# https://github.com/frappe/frappe_docker
compose.yaml
example.env
overrides

View File

@ -0,0 +1,24 @@
x-erpnext-backend-image: &erpnext_backend_image
image: frappe/erpnext-worker:${ERPNEXT_VERSION:?No ERPNext version set}
services:
configurator:
<<: *erpnext_backend_image
backend:
<<: *erpnext_backend_image
frontend:
image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
queue-short:
<<: *erpnext_backend_image
queue-default:
<<: *erpnext_backend_image
queue-long:
<<: *erpnext_backend_image
scheduler:
<<: *erpnext_backend_image

View File

@ -0,0 +1,27 @@
services:
configurator:
environment:
DB_HOST: db
DB_PORT: 3306
depends_on:
db:
condition: service_healthy
db:
image: mariadb:10.6
healthcheck:
test: mysqladmin ping -h localhost --password=${DB_PASSWORD}
interval: 1s
retries: 15
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --skip-character-set-client-handshake
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?No db password set}
volumes:
- db-data:/var/lib/mysql
volumes:
db-data:

View File

@ -0,0 +1,4 @@
services:
frontend:
ports:
- $APP_PORT:8080

View File

@ -0,0 +1,16 @@
services:
configurator:
environment:
REDIS_CACHE: redis:6379/0
REDIS_QUEUE: redis:6379/1
REDIS_SOCKETIO: redis:6379/2
depends_on:
- redis
redis:
image: redis:6.2-alpine
volumes:
- redis-data:/data
volumes:
redis-data: