Setup by frappe_docker in the case of Domain name with Port Number

hi,

I am using frappe/ frappe_docker to setup with creating new site(s).

I have two issues:

  1. my frappe server is setup with a port number, eg. my.domain.com:9123, my.domain2.com:9123. I created the sites by following this command
docker exec -it \
    -e "SITE_NAME=$SITE_NAME" \
    -e "DB_ROOT_USER=$DB_ROOT_USER" \
    -e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \
    -e "ADMIN_PASSWORD=$ADMIN_PASSWORD" \
    -e "INSTALL_APPS=erpnext" \
    <project-name>_erpnext-python_1 docker-entrypoint.sh new

$SITE_NAME – this SITE_NAME must be included port no., eg. my.domain.com:9123
I did this, and it works, but it has a issue that if my server port no. is changed, then site names also be changed too.

  1. backup command
docker exec -it \
    -e "SITES=my.domain.com:9123" \
    -e "WITH_FILES=1" \
    <project-name>_erpnext-python_1 docker-entrypoint.sh backup

SITES – it has problem now which my domain name including “:” for port number.

I tried "" or “/” else possible skip character, but it does not works.

Is it any better method to handle the port number with domain?

P.S.
Is it the direction as skip bench? I find it is no Bench at frappe_docker, but a new set commands, eg. the above new site and backup comamnds, instead of it.

thanks
yan

Port based multi-tenancy is not available in docker README.

You can play around with docker-compose and publish relevant ports and proxy things on your own if port based multi tenancy is needed. Share your experience if you do that.

Bench is not installed in python worker image.

Sorry to let you mis-understanding, i am not using Port based multi-tenancy, i am still using “DNS based multitenancy” which the sites are my.domain.com:9123, my.domain2.com:9123, they are share same port number but different domains. I tried and these two domains are running now.

Inside docker-compose, i still expose port 80, i use traefik to expose my port, eg. 9123 outside world to access different sites.

I just have issue as backup command at this moment. At short, i can manually backup the mysql in command prompt myself.

For the reason of this configuration – my.domain.com:9123, actually i have port 80 domain my.domain.com for my frontend application.

P.S.
hi revant_one,
i see you have a Mobile App project – frappe-mobile-starter, i have a question regarding oAuth2, can we use mobile App as Client to login to Google (as OAuth Auth. server), then send token to Frappe REST API (as Resource Server) ?

I read the document in Token Based Authentication , Mobile App client send the token to Frappe which this token seems as generated from frappe(as role of OAuth Auth. server), however, i would like to use google or facebook token to access frappe(as resource server), is it possible for this situation at frappe V12 ?

-e "SITES=my.domain.com:9123"

Why are you adding port here? it checks directories under sites. add only site names. or if you skip this, it will backup all sites anyway.

Start a new thread.

Actually, my site #1 example is “https://my.domain.com:9123” and site #2https://my.domain2.com:9123

Remark: Again , all docker-compose expose is Port 80, i change the port from 9123 to (by traefik) 80.

These are my commands to create site and works:

docker exec -it \
    -e "SITE_NAME=my.domain.com:9123" \
    -e "DB_ROOT_USER=root" \
    -e "MYSQL_ROOT_PASSWORD=my_password" \
    -e "ADMIN_PASSWORD=my_password1" \
    -e "INSTALL_APPS=erpnext" \
    frappe12_erpnext-python_1 docker-entrypoint.sh new

and

docker exec -it \
    -e "SITE_NAME=my.domain2.com:9123" \
    -e "DB_ROOT_USER=root" \
    -e "MYSQL_ROOT_PASSWORD=my_password2" \
    -e "ADMIN_PASSWORD=my_password3" \
    -e "INSTALL_APPS=erpnext" \
    frappe12_erpnext-python_1 docker-entrypoint.sh new

However, if i remove the port numbers, they do not work, eg.

docker exec -it \
    -e "SITE_NAME=my.domain2.com" \
    -e "DB_ROOT_USER=root" \
    -e "MYSQL_ROOT_PASSWORD=my_password2" \
    -e "ADMIN_PASSWORD=my_password3" \
    -e "INSTALL_APPS=erpnext" \
    frappe12_erpnext-python_1 docker-entrypoint.sh new

When i load my.domain2.com:9123, the site will redirect back to my.domain2.com and err.

So finally, i checked the site folder, it is sites/my.domain2.com:9123/ too.

After you point this point, let me have a look in return forward port number handling at traefik.