2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-10 15:20:55 +00:00
frappe_docker/build/common/commands
girish pasupathy 7498d5439a Support for reading Mariadb and Admin password from file when using docker secrets
With this PR, password can be read from docker secrets in both compose as well as swarm environment.

```YAML

secrets:
  mariadb-root-password:
    file: mariadb-root-password.txt
  erpnext-admin-password:
    file: erpnext-admin-password.txt

services:
  erpnext:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION:-v12.5.2}
    environment:
      - SITE_NAME=example.com
      - DB_ROOT_USER=root
      - MARIADB_HOST=mariadb
      - INSTALL_APPS=erpnext
      - FORCE=1
      - REDIS_CACHE=redis-cache:6379
      - REDIS_QUEUE=redis-queue:6379
      - REDIS_SOCKETIO=redis-socketio:6379
      - SOCKETIO_PORT=9000
      - AUTO_MIGRATE=1
      - ADMIN_PASSWORD_FILE=/run/secrets/erpnext-admin-password
      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mariadb-root-password
    secrets:
      - erpnext-admin-password
      - mariadb-root-password
    restart: on-failure
    volumes:
      - erpnext-data:/home/frappe/frappe-bench/sites
      - assets-data:/home/frappe/frappe-bench/sites/assets
    links:
      - redis-cache
      - redis-queue
      - redis-socketio
      - mariadb
    depends_on:
      - mariadb
      - redis-cache
      - redis-queue
      - redis-socketio
    networks:
      - erpnext-net
```

Reference: [Addind docker secrets in to your images](https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images)

Changes to be committed:
	modified:   ../../README.md
	modified:   ../common/commands/new.py
	modified:   ../common/commands/restore_backup.py
	modified:   ../erpnext-nginx/docker-entrypoint.sh
2020-04-16 11:49:40 +05:30
..
auto_migrate.py fix: do not auto migrate on first run 2020-03-22 19:08:41 +05:30
background.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
backup.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
check_connection.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
console.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
doctor.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
migrate.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
new.py Support for reading Mariadb and Admin password from file when using docker secrets 2020-04-16 11:49:40 +05:30
push_backup.py fix: backup and restore 2020-03-27 16:07:12 +05:30
restore_backup.py Support for reading Mariadb and Admin password from file when using docker secrets 2020-04-16 11:49:40 +05:30
worker.py fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30