services: immich-redis: container_name: Immich-REDIS image: docker.io/valkey/valkey:${REDIS_VERSION} cpu_shares: 512 mem_limit: 512m hostname: immich-redis security_opt: - no-new-privileges:true healthcheck: test: ["CMD-SHELL", "redis-cli ping || exit 1"] user: 1026:100 volumes: - ${REDIS_LOCATION}:/data:rw restart: unless-stopped immich-db: image: ghcr.io/immich-app/postgres:16-vectorchord0.4.3-pgvectors0.2.0 container_name: Immich-DB cpu_shares: 2048 mem_limit: 3g hostname: immich-db security_opt: - no-new-privileges:true volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data:rw environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_INITDB_ARGS: '--data-checksums' DB_STORAGE_TYPE: ${DB_STORAGE_TYPE} restart: unless-stopped immich-server: image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} container_name: Immich-SERVER cpu_shares: 1536 mem_limit: 1g hostname: immich-server user: 1026:100 security_opt: - no-new-privileges:true env_file: - .env ports: - 8212:2283 volumes: - ${UPLOAD_LOCATION}:/data:rw - /etc/localtime:/etc/localtime:ro restart: unless-stopped depends_on: immich-redis: condition: service_healthy immich-db: condition: service_started immich-machine-learning: image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} container_name: Immich-LEARNING cpu_shares: 768 mem_limit: 3g hostname: immich-machine-learning user: 1026:100 security_opt: - no-new-privileges:true env_file: - .env volumes: - ${UPLOAD_LOCATION}:/data:rw - ${CACHE_LOCATION}:/cache:rw - ${CACHE_LOCATION}:/.cache:rw - ${CACHE_LOCATION}:/.config:rw - ${MATPLOTLIB_LOCATION}:/matplotlib:rw environment: MPLCONFIGDIR: /matplotlib restart: unless-stopped depends_on: immich-db: condition: service_started