Help with setting up multi-site ERPNext

Hi, using this docker-compose (https://github.com/DeveloperRaju23/Dokploy-ERPNext) I've managed to get ERPNext up and running on Dokploy but it seems to only work for one site. I know Frappe is able to handle multiple sites on one bench but I can't seem to get it working. Here's my docker-compose.yml. Only the frappe-site works but the erp-site returns a 502 error. @NoMansLand Any ideas on how to get this working?
GitHub
GitHub - DeveloperRaju23/Dokploy-ERPNext
Contribute to DeveloperRaju23/Dokploy-ERPNext development by creating an account on GitHub.
10 Replies
Harvey Specter
Harvey Specter6mo ago
As I remember you need just restart the site service I tried to add this template, but it's cause an issues
Gabe Vigodi
Gabe VigodiOP6mo ago
Yeah, I managed to get the setup working but I wasn't enjoying the app installation/update process so I opted for a different setup. Here's the Caddyfile that needs to be added as a file mount:
:80 {
root * /home/frappe/frappe-bench/sites
file_server /assets/* {
root /home/frappe/frappe-bench/sites
}
reverse_proxy /socket.io/* websocket:9000
@notStatic {
not path /assets/*
not path /socket.io/*
}
reverse_proxy @notStatic 0.0.0.0:8000
encode gzip
header {
X-Frame-Options "SAMEORIGIN"
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "same-origin, strict-origin-when-cross-origin"
}
}
:80 {
root * /home/frappe/frappe-bench/sites
file_server /assets/* {
root /home/frappe/frappe-bench/sites
}
reverse_proxy /socket.io/* websocket:9000
@notStatic {
not path /assets/*
not path /socket.io/*
}
reverse_proxy @notStatic 0.0.0.0:8000
encode gzip
header {
X-Frame-Options "SAMEORIGIN"
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "same-origin, strict-origin-when-cross-origin"
}
}
saashqdev
saashqdev6mo ago
Very helpful - where do you add the Caddy file mount? (I'm new to Dokploy)
Gabe Vigodi
Gabe VigodiOP6mo ago
@saashqdev
No description
saashqdev
saashqdev6mo ago
Perfect, thanks Quick question: What service name and container port do I choose when creating a domain for ERPNext? By looking at the docker compose I'm assuming site1 / port 8080 Weird, the docker deploys fine, I can ping my domain: erp.saashqcloud.com and yet I keep getting Unable to connect in the browser.
Gabe Vigodi
Gabe VigodiOP6mo ago
Actually you should provide port 80 since that's the container port
web:
image: caddy:2-alpine
expose:
- 80
volumes:
- ../files/Caddyfile:/etc/caddy/Caddyfile
- ../files/frappe-bench:/home/frappe/frappe-bench
depends_on:
- backend
- websocket
networks:
- dokploy-network
web:
image: caddy:2-alpine
expose:
- 80
volumes:
- ../files/Caddyfile:/etc/caddy/Caddyfile
- ../files/frappe-bench:/home/frappe/frappe-bench
depends_on:
- backend
- websocket
networks:
- dokploy-network
saashqdev
saashqdev6mo ago
ah ok netstat shows no ports listening on 80 or 443 on my hetzner box Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 756/systemd-resolve tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 756/systemd-resolve tcp6 0 0 :::2377 :::* LISTEN 950/dockerd
tcp6 0 0 :::22 :::* LISTEN 1/init
tcp6 0 0 :::7946 :::* LISTEN 950/dockerd
udp 0 0 0.0.0.0:4789 0.0.0.0:* -
udp 0 0 127.0.0.54:53 0.0.0.0:* 756/systemd-resolve udp 0 0 127.0.0.53:53 0.0.0.0:* 756/systemd-resolve udp 0 0 65.21.50.87:68 0.0.0.0:* 771/systemd-network udp6 0 0 :::7946 :::* 950/dockerd
saashqdev
saashqdev6mo ago
All the dockers seem to be OK
saashqdev
saashqdev6mo ago
docker network list NETWORK ID NAME DRIVER SCOPE d582425fb586 bridge bridge local 9dbb5ebae552 docker_gwbridge bridge local d92d49f2211b dokploy-network bridge local 61b6de7674e9 host host local b7xszsh384q6 ingress overlay swarm d7e697a5c706 none null local Just inspecting the logs; sites-x seem to be up, Redis is up, All others are Waiting for configuration to be completed... Waiting for configuration to be completed... Waiting for configuration to be completed... mariadb: 2024-11-25 20:28:07+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified You need to specify one of MARIADB_ROOT_PASSWORD, MARIADB_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD I don't think the install is completing setting a DB_PASSWORD in the ENV - trying again
Gabe Vigodi
Gabe VigodiOP6mo ago
DB_ROOT_PASSWORD

Did you find this page helpful?