searxng / searxng-docker

The docker-compose files for setting up a SearXNG instance with docker.
GNU Affero General Public License v3.0
1.21k stars 290 forks source link

How to change the listening port inside the container/image? #175

Closed TomErnst1972 closed 1 year ago

TomErnst1972 commented 1 year ago

Hi,

I'm using the docker version today with -p 8123:8080, but I'd like to be able to use --net=host, therefore I'd like to ask if there is some "-e WHATVER_VARIABLE=PORTNUMBER" to achieve this.

Basically the internal listening port has to be changed from outside (docker run, or docker-compose.yaml)

Changing this: -e "BASE_URL=http://my.base.url:6766/" \

or trying -e PORT=6766

didnt help. Any ideas?

best regards, Tom

StarryMoe commented 1 year ago

Hi,

Please try: BIND_ADDRESS=0.0.0.0:6766

It works for me. The reason is here: #20

TomErnst1972 commented 1 year ago

yeah, found that out, too. Here's what I use: docker run --restart always -d --net=host \ -e BIND_ADDRESS=0.0.0.0:6766 \ -e DEFAULT_BIND_ADDRESS=0.0.0.0:6766 \ -v "/opt/searx:/etc/searxng" \ -e "BASE_URL=http://xxx.yyy.zzz/" \ -e "INSTANCE_NAME=searxNG" \ --name search \ searxng/searxng