What config is used when installing with docker (LoraServer)?

When using docker, is there any config file specified (can’t seem to find any)? If so, what config is used and how do you edit it? If no, how can you use a config file?

I’m thinking about this config: https://docs.loraserver.io/loraserver/install/config/

The configuration files were introduced recently (as in last week). Before all the configuration was set using environment variables, which still works in the new situation in a backwards compatible way. You can still use this (e.g. see https://docs.loraserver.io/install/docker/), but I recommend you to start using configuration files. This example will be updated soon :slight_smile:

By default these are loaded from /etc/loraserver/loraserver.toml (in case of LoRa Server), so in order to make this work with Docker, you need to create a volume where you expose a local folder as volume to /etc/loraserver. I believe what you need is the -v flag: -v /host/directory/loraserver:/etc/loraserver. Then your would have your configuration in /host/directory/loraserver/loraserver.toml.

Thank you. I was thinking about when adding a network server via the GUI. Is the default port 8000? Aka you should specify the [network_server.api] ip/port from the lora server (loraserver instead of localhost when using docker) in the GUI when adding a new network server?

Short answer: Scroll a bit down on the Docker page :wink:

Longer answer: when LoRa Server is binding to the means it is binding to all interfaces on port 8000. What you need to enter in the web-interface depends how the two containers are linked. In the docker-compose.yml example you need to use loraserver:8000 as the LoRa Server services is resolvable by the hostname loraserver.

Sorry, I was not clear. That was why I asked if port 8000 is default (because it’s used on the docker page without any specifications in the docker-compose that the lora server is running at 8000). But if I understand you that is correct.

This might be a question more related to docker (and might require me to create another thread). But if I run:

docker-compose run --rm loraserver bash

It should spawn a shell in the latest build (what I understand it’s a multi-stage build)?

FROM alpine:latest AS production

WORKDIR /root/
RUN apk --no-cache add ca-certificates tzdata
COPY --from=development /go/src/github.com/brocaar/loraserver/build/loraserver .
ENTRYPOINT ["./loraserver"]

So I should have an executable in /root/ with name loraserver? My guess is I’m missing a bunch. What should be the next step after running docker-compose run --rm loraserver bash? Or is it that simple that I just need to compile it via make command (if so, is the docker file not executed?)?

Don’t mind that. Saw that another Dockerfile is used. (Dockerfile-devel)

Don’t use the docker-compose.yml file from the loraserver, lora-app-server or lora-gateway-bridge repositories. These are for development. You should be able to copy & paste this one: https://docs.loraserver.io/install/docker/. All containers will be fetched from https://hub.docker.com/r/loraserver/.

But I wanna use it for development. (I’m not very familiar with docker…) :frowning:

This is what I experienced:

  1. docker-compose run --rm loraserver bash
  2. The container builds for the first time, seems that everything in the dockerfile is executed.
  3. There is no /build folder in path the shell spawned in.
  4. I used the make commands, and then run the executable in the /build folder.

Seems like the /build folder should be there (in other words step 4 is done twice?), because of the output when I built the image the first time.

Step 14/14 : RUN make
 ---> Running in 7a4212655e0a
Building ui

(Above is from app-server, but you get the point)

Please let not mix two questions in one topic :slight_smile: I think I answered your question with regards to configuration There are other topics to discuss compilation: https://forum.loraserver.io/search?q=compiling.

Hii @brocaar

we need to install loraserver for production using docker which version we are using for production and what configuration we need to change for production usages

can we use below repository for production use?

The loraserver-docker repo is a good starting point for building your own configuration for use in production. The actual configuration will vary greatly depending on your delpoyment details and use case.

I added the -env docker-compose file, which was used as the (very simple) basis for our LoRa Server deployment on Kubernetes.