2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-16 17:19:03 +00:00

fix: make changes for backward compat

make changes for refactor to work on existing setups
This commit is contained in:
Revant Nandgaonkar 2022-03-07 12:30:23 +05:30
parent e1f32b7476
commit 09060341c7
2 changed files with 32 additions and 25 deletions

View File

@ -38,6 +38,13 @@ services:
- FRAPPE_SOCKETIO=frappe-socketio
- SOCKETIO_PORT=9000
- SKIP_NGINX_TEMPLATE_GENERATION=${SKIP_NGINX_TEMPLATE_GENERATION}
# For refactored images
- BACKEND=erpnext-python:8000
- SOCKETIO=frappe-socketio: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}
labels:
- "traefik.enable=true"
- "traefik.http.routers.erpnext-nginx.rule=Host(${SITES})"
@ -75,7 +82,7 @@ services:
erpnext-worker-default:
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
restart: on-failure
command: worker
command: ["bench", "worker", "--queue", "default"]
depends_on:
- redis-queue
- redis-cache
@ -86,9 +93,7 @@ services:
erpnext-worker-short:
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
restart: on-failure
command: worker
environment:
- WORKER_TYPE=short
command: ["bench", "worker", "--queue", "short"]
depends_on:
- redis-queue
- redis-cache
@ -99,9 +104,7 @@ services:
erpnext-worker-long:
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
restart: on-failure
command: worker
environment:
- WORKER_TYPE=long
command: ["bench", "worker", "--queue", "long"]
depends_on:
- redis-queue
- redis-cache
@ -111,7 +114,7 @@ services:
erpnext-schedule:
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
restart: on-failure
command: schedule
command: ["bench", "schedule"]
depends_on:
- redis-queue
- redis-cache
@ -147,28 +150,12 @@ services:
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
# Sometimes db initialization takes longer than 10 seconds and site-creator goes away.
# Sometimes db initialization takes longer than 10 seconds and site creation can cause error.
# Frappe doesn't use CONVERT_TZ() function that requires time zone info, so we can just skip it.
- MYSQL_INITDB_SKIP_TZINFO=1
volumes:
- mariadb-vol:/var/lib/mysql
site-creator:
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
restart: "no"
command: new
depends_on:
- erpnext-python
environment:
- SITE_NAME=${SITE_NAME}
- DB_ROOT_USER=${DB_ROOT_USER}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- INSTALL_APPS=${INSTALL_APPS}
volumes:
- sites-vol:/home/frappe/frappe-bench/sites:rw
- logs-vol:/home/frappe/frappe-bench/logs:rw
volumes:
mariadb-vol:
redis-cache-vol:

View File

@ -82,6 +82,26 @@ Notes:
- The local deployment is for testing and REST API development purpose only
- A complete development environment is available [here](../development)
## Create Site
Set environment variables
```sh
export $(cat .env | xargs)
```
Create site as per use and install apps optionally.
```sh
docker-compose exec erpnext-python bench new-site ${SITE_NAME} --mariadb-root-username=${DB_ROOT_USER} --mariadb-root-password=${MYSQL_ROOT_PASSWORD} --admin-password=${ADMIN_PASSWORD} --install-app=${INSTALL_APPS} --db-type=mariadb --no-mariadb-socket
```
If this is the first site created then remove `currentsite.txt` to unset default site.
```sh
docker-compose exec erpnext-python rm -f currentsite.txt
```
## Docker containers
The docker-compose file contains following services: