-
Notifications
You must be signed in to change notification settings - Fork 27
Environments
fm
provides two distinct environments for managing benches: production (prod
) and development (dev
). This flexibility allows users to create and update benches with specific configurations suitable for either environment.
-
Dev Packages: Development packages defined in Frappe's
[tool.bench.dev-dependencies]
section of thepyroject.toml
are removed from bench's python env. - Supervisor Config: The Frappe production supervisor configuration is used, which runs the Frappe web application using Gunicorn server.
-
Dev Packages: Development packages defined in Frappe's
[tool.bench.dev-dependencies]
section of thepyroject.toml
are installed into bench's python env. -
Supervisor ConfigThe development supervisor configuration is used, which includes running the Frappe development server and watch service.
By managing these environments effectively, you can ensure that your benches are configured appropriately for their intended use, whether it be for production deployment or ongoing development. Below are the environment related operations which can be performed.
To create a new bench, use the create command with the --env
flag to specify the desired environment. If the --env
flag is not provided, the create
command defaults to the development environment.
fm create example.com --env <prod/dev>
fm create example.com --env prod
You can update the environment of an existing bench using the update
command along with the --env
flag. This allows for changing the environment at any time.
fm update example.com --env <prod/dev>
fm update example.com --env dev
Alternatively, you can update the bench's environment by modifying the bench_config.toml
file. Change the environment_type
key to either "prod" or "dev", and then run the start
command to apply the changes.
-
Update the config's key value pair with the specified below.
# bench_config.toml environment_type = "prod"
-
Start the site again to reflect chagnes
fm start <bench>