Run erpnext on localhost
See original GitHub issueHi,
I have no idea how to run the containers in this repo. I want to run the most basic erpnext production setup. Preferably with postgres. No reverse-proxy (Already have one).
I’ll document my steps here.
git clone https://github.com/frappe/frappe_docker
cd frappe_docker
We provide simple and intuitive production setup with prebuilt Frappe and ERPNext images and compose files. To learn more about those, read the docs.
From the docs in Compose files
After building the images we have to run the containers.
So I assume the Dockerfiles need to be built before proceeding.
/bench successfully builds.
/nginx fails with fatal: repository 'apps/frappe' does not exist
but that’s okay. Not critical for my setup.
/socketio and /worker fail similarly.
Maybe it’s not necessary to prebuild, we continue.
Considering the naming of overrides, I’ll run compose.yml as is.
Fails with RuntimeError: Required environment variable "REDIS_CACHE" not set
. Okay cool .env not set but it is mentioned lower down.
Selecting overrides and env vars:
- compose.noproxy.yaml to expose ports to host
- compose.erpnext.yaml I don’t want other apps
- compose.postgres.yaml Override db service to use postgres
Final compose builder script:
docker compose \
-f compose.yaml \
-f overrides/compose.noproxy.yaml \
-f overrides/compose.postgres.yaml \
-f overrides/compose.erpnext.yaml \
config > ./test-compose.yaml
The .env (comments removed for a smaller post):
FRAPPE_VERSION=v14.3.0
ERPNEXT_VERSION=v14.0.1
DB_PASSWORD=changeit
LETSENCRYPT_EMAIL=mail@example.com
FRAPPE_SITE_NAME_HEADER=
UPSTREAM_REAL_IP_ADDRESS=
UPSTREAM_REAL_IP_HEADER=
UPSTREAM_REAL_IP_RECURSIVE=
ROUTER=erpnext-one
SITES=localhost
BENCH_NETWORK=erpnext-one
First error:
RuntimeError: Required environment variable "REDIS_CACHE" not set
Docs on this page don’t show manual loading of .env is required.
docker-compose --env-file ./.env -f comp ......
Variables with a description are not actually optional:
Set only if external service for database is used.
So looks like I need to include override redis no matter what. New .env:
FRAPPE_VERSION=v14.3.0
ERPNEXT_VERSION=v14.0.1
DB_PASSWORD=changeit
DB_HOST=db
DB_PORT=5432
REDIS_CACHE=
REDIS_QUEUE=
REDIS_SOCKETIO=
LETSENCRYPT_EMAIL=mail@example.com
FRAPPE_SITE_NAME_HEADER=
UPSTREAM_REAL_IP_ADDRESS=
UPSTREAM_REAL_IP_HEADER=
UPSTREAM_REAL_IP_RECURSIVE=
ROUTER=erpnext-one
SITES=localhost
BENCH_NETWORK=erpnext-one
New docker config:
docker compose --env-file ./.env \
-f compose.yaml \
-f overrides/compose.noproxy.yaml \
-f overrides/compose.postgres.yaml \
-f overrides/compose.erpnext.yaml \
-f overrides/compose.redis.yaml \
config > ./test-compose.yaml
The compose now starts successfully: frontend access shows localhost/0.0.0.0 does not exist After adding FRAPPE_SITE_NAME_HEADER = localhost doesn’t change the error Setting sites to one.example.com and adding that to my host’s hosts gives the same error.
I’ve tried many things not documented here but I feel like this was pretty much following the docs. I would appreciate some help getting erpnext running.
This process is a clean pull of master.
Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
download pwd.yml from root of this repo and use it to deploy single site locally. read through the file to change admin password, image, install apps.
wait for site creation to complete
visit
http://localhost:8080
Okay thank you. Then it works correctly.