2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-20 02:59:02 +00:00
frappe_docker/docs/setup-options.md
Revant Nandgaonkar e6088af885
refactor: build only one frappe/erpnext image (#1032)
* ci: skip frappe builds

* refactor: build only one frappe/erpnext image

* fix: lint nginx entrypoint script

* docs: update and organize docs

* docs: fix lint errors

* fix(custom): pass base64 encoded apps json

* ci: update dependabot

* docs: update contributing

* docs: remove info about multi image setup

* fix: initiate empty common_site_config.json

default config has host keys set to localhost
causes connection errors

* docs: add details for pwd volumes

* fix: symlink assets instead of copy

* fix: nginx private files

* ci: skip docker compose v2 install for ubuntu-latest

* fix: organize layers

* feat: allow remove git remote for custom image

* docs: allow remove git remote for custom image

* fix: remove duplicate --apps_path
2023-01-16 04:20:09 +05:30

3.9 KiB

Containerized Production Setup

Make sure you've cloned this repository and switch to the directory before executing following commands.

Commands will generate YAML as per the environment for setup.

Prerequisites

Setup Environment Variables

Copy the example docker environment file to .env:

cp example.env .env

Note: To know more about environment variable read here. Set the necessary variables in the .env file.

Generate docker-compose.yml for variety of setups

Notes:

  • Make sure to replace <project-name> with the desired name you wish to set for the project.
  • This setup is not to be used for development. A complete development environment is available here

Store the yaml files

YAML files generated by docker compose config command can be stored in a directory. We will create a directory called gitops in the user's home.

mkdir ~/gitops

You can make the directory into a private git repo which stores the yaml and secrets. It can help in tracking changes.

Instead of docker compose config, you can directly use docker compose up to start the containers and skip storing the yamls in gitops directory.

Setup Frappe without proxy and external MariaDB and Redis

In this case make sure you've set DB_HOST, DB_PORT, REDIS_CACHE, REDIS_QUEUE and REDIS_SOCKETIO environment variables or the configurator will fail.

# Generate YAML
docker compose -f compose.yaml -f overrides/compose.noproxy.yaml config > ~/gitops/docker-compose.yml

# Start containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -d

Setup ERPNext with proxy and external MariaDB and Redis

In this case make sure you've set DB_HOST, DB_PORT, REDIS_CACHE, REDIS_QUEUE and REDIS_SOCKETIO environment variables or the configurator will fail.

# Generate YAML
docker compose -f compose.yaml \
  -f overrides/compose.proxy.yaml \
  config > ~/gitops/docker-compose.yml

# Start containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -d

Setup Frappe using containerized MariaDB and Redis with Letsencrypt certificates.

# Generate YAML
docker compose -f compose.yaml \
  -f overrides/compose.mariadb.yaml \
  -f overrides/compose.redis.yaml \
  -f overrides/compose.https.yaml \
  config > ~/gitops/docker-compose.yml

# Start containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -d

Setup ERPNext using containerized MariaDB and Redis with Letsencrypt certificates.

# Generate YAML
docker compose -f compose.yaml \
  -f overrides/compose.mariadb.yaml \
  -f overrides/compose.redis.yaml \
  -f overrides/compose.https.yaml \
  config > ~/gitops/docker-compose.yml

# Start containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -d

Create first site

After starting containers, the first site needs to be created. Refer site operations.

Updating Images

Switch to the root of the frappe_docker directory before running the following commands:

# Update environment variables ERPNEXT_VERSION and FRAPPE_VERSION
nano .env

# Pull new images
docker compose -f compose.yaml \
  # ... your other overrides
  config > ~/gitops/docker-compose.yml

docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml pull

# Stop containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml down

# Remove assets volume for repopulation
docker volume rm <name of assets volume>

# Restart containers
docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -d

To migrate sites refer site operations