Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detail to reverse proxy docs #2841

Merged
merged 2 commits into from
Jul 1, 2023
Merged

Conversation

fwsmit
Copy link
Contributor

@fwsmit fwsmit commented Jun 18, 2023

Document fix for issue #2564

@vercel
Copy link

vercel bot commented Jun 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
immich ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2023 6:28pm

@JVT038
Copy link

JVT038 commented Jun 19, 2023

Maybe add an example for Traefik (V2) as well? I can post my Traefik config here

client_max_body_size 50000M;

location / {
proxy_pass http://<snip>/2283;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be http://<snip>:2283

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @fwsmit Can you help address the issue above?

@JVT038
Copy link

JVT038 commented Jun 19, 2023

In case you want to add traefik reverse proxy example, this is mine with unix sockets instead of TCP sockets. (Which is why there's a /socket mount)

version: "3.8"

networks:
  traefik_proxy:
    external:
      name: traefik_proxy

services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    command: ['start-server.sh']
    networks:
      - traefik_proxy
      - default
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - sockets:/sockets
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
      - typesense
    restart: always
    labels:
      traefik.enable: "true"
      traefik.docker.network: traefik_proxy
      traefik.http.services.immich-api-svc.loadbalancer.server.port: "3001"
      traefik.http.routers.immich-api-rtr.rule: "Host(`immich.$DOMAINNAME`) && Pathprefix(`/api`)"
      traefik.http.routers.immich-api-rtr.priority: 20
      traefik.http.middlewares.immich-api-strip.stripprefix.prefixes: "/api"
      traefik.http.routers.immich-api-rtr.middlewares: immich-api-strip,chain-basic@file
      traefik.http.routers.immich-api-rtr.service: immich-api-svc
      traefik.http.routers.immich-api-rtr.tls: true
      traefik.http.routers.immich-api-rtr.tls.certresolver: dns-cloudflare
      traefik.http.routers.immich-api-rtr.entrypoints: https

  immich-microservices:
    image: ghcr.io/immich-app/immich-server:release
    command: ['start-microservices.sh']
    networks:
      - default
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - sockets:/sockets
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    build:
      context: $DOCKERDIR/immich/immich-ml
      dockerfile: Dockerfile
    container_name: immich_machine_learning
    command: [ "python", "src/main.py" ]
    networks:
      - default
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    restart: always

  immich-web:
    image: ghcr.io/immich-app/immich-web:release
    networks:
      - default
      - traefik_proxy
    env_file:
      - .env
    restart: always
    labels:
      traefik.enable: "true"
      traefik.docker.network: traefik_proxy
      traefik.http.services.immich-svc.loadbalancer.server.port: "3000"
      traefik.http.routers.immich-rtr.rule: "Host(`immich.$DOMAINNAME`)"
      traefik.http.routers.immich-rtr.priority: 10
      traefik.http.routers.immich-rtr.service: immich-svc
      traefik.http.routers.immich-rtr.middlewares: chain-basic@file
      traefik.http.routers.immich-rtr.tls: true
      traefik.http.routers.immich-rtr.tls.certresolver: dns-cloudflare
      traefik.http.routers.immich-rtr.entrypoints: https

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always
    networks:
      - default
    command: redis-server /etc/redis.conf
    volumes:
      - sockets:/sockets
      - $DOCKERDIR/immich/redis.conf:/etc/redis.conf
      - /etc/TZ:/etc/timezone:ro
      - $DOCKERDIR/immich/redisdb:/db

  database:
    container_name: immich_postgres
    image: postgres:14-bullseye
    user: 1026:100
    command: postgres -c unix_socket_directories='/var/run/postgresql/,/sockets/'
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
      PGPORT: ${DB_PORT}
    volumes:
      - $DOCKERDIR/immich/pgdata:/var/lib/postgresql/data
      - sockets:/sockets
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    restart: always
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
    logging:
      driver: none
    volumes:
      - $DOCKERDIR/immich/typesense:/data

  # immich-proxy:
  #   container_name: immich_proxy
  #   image: ghcr.io/immich-app/immich-proxy:release
  #   ports:
  #     - 2283:8080
  #   logging:
  #     driver: none
  #   depends_on:
  #     - immich-server
  #   networks:
  #     - default
  #     - traefik
  #   restart: always
  #   labels:
  #     - "traefik.enable=true"
  #     ## HTTP Routers
  #     - "traefik.http.routers.immich-rtr.entrypoints=https"
  #     - "traefik.http.routers.immich-rtr.rule=Host(`immich.$DOMAINNAME`)"
  #     ## Middlewares
  #     - "traefik.http.routers.immich-rtr.middlewares=chain-basic@file"
  #     ## HTTP Services
  #     - "traefik.http.routers.immich-rtr.service=immich-svc"
  #     - "traefik.http.services.immich-svc.loadbalancer.server.port=2283"

volumes:
  sockets:
    external: true
  model-cache:

@alextran1502 alextran1502 merged commit 604b107 into immich-app:main Jul 1, 2023
18 checks passed
@fwsmit
Copy link
Contributor Author

fwsmit commented Jul 1, 2023

Thanks for fixing the typo and merging.

The traefic example feels like it's more a separate install method, since it seems to include both the starting of containers and the network routing. It looks like it replaces docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants