Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to reference br0 in a docker compose file

Featured Replies

I am an absolute idiot when it comes to compose files, this is my first try at one.

I am trying to run Immich (which I have working via this guide), but I want to set it to run on a separate IP instead of the bridged IP with my unRAID server.

My unRAID server is 192.168.10.40, and by default Immich runs at 192.168.10.40:2283. I want to edit the compose file to run the Immich server (or stack?) via br0 on a different network. All my dockers that I allow external access to are on a different VLAN, so I would like Immich do exist on that VLAN as well. How do I modify my compose file to do this?

name: immich

services:

immich-server:

container_name: immich_server

image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}

# extends:

# file: hwaccel.transcoding.yml

# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding

volumes:

# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file

- ${UPLOAD_LOCATION}:/data

- /etc/localtime:/etc/localtime:ro

- ${PHONE_PHOTOS}:/home/user/PhonePhotos:ro

env_file:

- .env

ports:

- '2283:2283'

depends_on:

- redis

- database

restart: always

healthcheck:

disable: false

immich-machine-learning:

container_name: immich_machine_learning

# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.

# Example tag: ${IMMICH_VERSION:-release}-cuda

image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}

# extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration

# file: hwaccel.ml.yml

# service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the -wsl version for WSL2 where applicable

volumes:

- model-cache:/cache

env_file:

- .env

restart: always

healthcheck:

disable: false

redis:

container_name: immich_redis

image: docker.io/valkey/valkey:8@sha256:81db6d39e1bba3b3ff32bd3a1b19a6d69690f94a3954ec131277b9a26b95b3aa

healthcheck:

test: redis-cli ping || exit 1

restart: always

database:

container_name: immich_postgres

image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23

environment:

POSTGRES_PASSWORD: ${DB_PASSWORD}

POSTGRES_USER: ${DB_USERNAME}

POSTGRES_DB: ${DB_DATABASE_NAME}

POSTGRES_INITDB_ARGS: '--data-checksums'

# Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs

# DB_STORAGE_TYPE: 'HDD'

volumes:

# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file

- ${DB_DATA_LOCATION}:/var/lib/postgresql/data

shm_size: 128mb

restart: always

volumes:

model-cache:

Edited by ati

  • 3 weeks later...

you have to declare networks in your compose file

In the example below i use 2 networks for the immich server

eth0.30 is macvlan network in my dmz vlan

immich is a bridge network

only immich server is in the eth0.30 network. All the other containers are in immich network.

you also have to declare the type of network at the end of the file at the same level as services.

In my case networks are created outside of the compose file hence the external: true statement. But you can't manage them inside the file. I advise you to read docker networking docs.

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external
#    env_file:
#      - .env
    ports:
      - 192.168.30.10:2283:2283
#    expose:
#      - "2283"
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false
    networks:
      eth0.30:
        ipv4_address: 192.168.30.10
      immich:

networks:
  eth0.30:
    external: true
    name: eth0.30
  immich:
    external: true
  • 2 weeks later...
  • Author

I am still running into issues.

I am trying, to start, to just run the Immich server on my main VLAN which is br0 and leave all the other Immich containers on their default network.

So I have this in my otherwise default from Immich compose file. (from here: https://github.com/immich-app/immich/releases/tag/v2.4.1)

name: immich

services:
  immich-server:
...
    ports:
      - 192.168.10.137:2283:2283
...
    networks:
      br0:
        ipv4_address: 192.168.10.137

However, when I do this, the sever will not start. Presumably there is a missing link between my br0 network and the default Immich compose network? How do I set the main server to have 2 interfaces? The network the other containers use is 'immich_default', but I see no reference to that in the compose file, so how do I add that as a network for the immich_server docker? Whenever I do try and add it, it says it is not defined in the compose messages when starting the stack.

  • Author

Well I got it to work once making a custom internal network, now I get this error after I try to start the stack again:

Error response from daemon: driver failed programming external connectivity on endpoint immich_server
(04565a5b1f19222fe7a7245130294e2f27b8b6fe6c51dc81b6fd7bbc36b00da0): Error starting userland proxy: listen tcp4 192.168.10.137:2283: bind: cannot assign requested address

Edited by ati

  • Community Expert

your compose has this:

    ports:
      - 192.168.30.10:2283:2283

but ports section should only have ports:

    ports:
      - 2283:2283

I don't think ports are required when setting static IPs, but will be ignored and can be a useful reference.

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.