Jump to content

docker-compose config for unraid


Recommended Posts

Posted

I want to host a little go backend program on my unraid server so I can receive HTTP requests from my contact form on my website and forward them using a Telegram bot.

 

But I have trouble getting the docker-compose configuration right.
My unraid server's IP Is 10.14.12.111 and I want the docker image to be on 10.14.12.85 on the "br0" network 

services:
  app:
    build: .
    ports:
      - "8080:8080"
    environment:
      - TELEGRAM_BOT_TOKEN=my_telegram_bot_token
      - TELEGRAM_CHAT_ID=my_chat_id
      - SERVER_HOST=10.14.12.85

I've also tried to set the network to "br0" in the compose file with no success.

Quote

2024/06/05 14:59:20 listen tcp 10.14.12.185:8080: bind: cannot assign requested address



My Dockerfile:

FROM golang:1.22-alpine

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN go build -o main .

ENV TELEGRAM_BOT_TOKEN=my_telegram_bot_token
ENV TELEGRAM_CHAT_ID=my_chat_id
ENV SERVER_HOST=10.14.12.85

CMD ["./main"]


I'm using the Docker Compose Manager plugin by the way if this is relevant.
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...