LibrePhotos / librephotos

A self-hosted open source photo management service. This is the repository of the backend.
MIT License
6.99k stars 306 forks source link

First setup not working (docker compose) #1487

Closed cdalexndr closed 2 days ago

cdalexndr commented 4 days ago

🛑 Before you create an issue make sure that:

When Submitting please remove every thing above this line

🐛 Bug Report

📝 Description of issue:

No first time setup. Login doesn't work. Backend seems to not work, there are errors in log.

image

🔁 How can we reproduce it:

compose.yaml:

# DO NOT EDIT
# The .env file has everything you need to edit.
# Run options:
# 1. Use prebuilt images (preferred method):
#   run cmd: docker compose up -d
# 2. Build images on your own machine:
#   build cmd: docker compose build
#   run cmd: docker compose up -d

services:
  proxy:
    image: reallibrephotos/librephotos-proxy:${tag}
    container_name: proxy
    restart: unless-stopped
    volumes:
      - ${scanDirectory}:/data
      - ${data}/protected_media:/protected_media
    ports:
      - 3000:80
    depends_on:
      - backend
      - frontend

  db:
    image: pgautoupgrade/pgautoupgrade:latest
    container_name: db
    restart: unless-stopped
    environment:
      - POSTGRES_USER=${dbUser}
      - POSTGRES_PASSWORD=${dbPass}
      - POSTGRES_DB=${dbName}
    volumes:
      - ${data}/db:/var/lib/postgresql/data
    healthcheck:
      test: psql -U ${dbUser} -d ${dbName} -c "SELECT 1;"
      interval: 5s
      timeout: 5s
      retries: 5

  frontend:
    image: reallibrephotos/librephotos-frontend:${tag}
    container_name: frontend
    restart: unless-stopped

  backend:
    image: reallibrephotos/librephotos:${tag}
    container_name: backend
    restart: unless-stopped
    volumes:
      - ${scanDirectory}:/data
      - ${data}/protected_media:/protected_media
      - ${data}/logs:/logs
      - ${data}/cache:/root/.cache
    environment:
      - SECRET_KEY=${shhhhKey:-}
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=${adminEmail:-}
      - ADMIN_USERNAME=${userName:-}
      - ADMIN_PASSWORD=${userPass:-}
      - DB_BACKEND=postgresql
      - DB_NAME=${dbName}
      - DB_USER=${dbUser}
      - DB_PASS=${dbPass}
      - DB_HOST=${dbHost}
      - DB_PORT=5432
      - MAPBOX_API_KEY=${mapApiKey:-}
      - WEB_CONCURRENCY=${gunniWorkers:-1}
      - SKIP_PATTERNS=${skipPatterns:-}
      - ALLOW_UPLOAD=${allowUpload:-false}
      - CSRF_TRUSTED_ORIGINS=${csrfTrustedOrigins:-}
      - DEBUG=0
    depends_on:
      db:
        condition: service_healthy

.env

# This file contains all the things you need to change to set up your Libre Photos. 
# There are a few items that must be set for it to work such as the location of your photos.

# Start of mandatory changes. 

# Location of your photos.
scanDirectory=/hdd/media

# Internal data of LibrePhotos
data=./librephotos/data

# ------------------------------------------------------------------------------------------------

# Wow, we are at the optional now. Pretty easy so far. You do not have to change any of the below.

# Set this value if you have a custom domain name. This allows django-admin access. If you do not have a custom domain name, leave this blank.
csrfTrustedOrigins=

#What port should Libre Photos be accessed at (Default 3000)
httpPort=3000

# What branch should we install the latest weekly build or the development branch (dev)
tag=latest

# Number of workers, which take care of the request to the api. This setting can dramatically affect the ram usage.
# A positive integer generally in the 2-4 x $(NUM_CORES) range.
# You’ll want to vary this a bit to find the best for your particular workload. Default is 2.
gunniWorkers=2

# You can set the database name. Did you know Libre Photos was forked from OwnPhotos?
dbName=librephotos

# Here you can change the user name for the database.
dbUser=docker

# The password used by the database.
dbPass=AaAa1234

# Database host. Only change this if you want to use your own existing Postgres server. If using your own server, you can remove the 'db' container from docker-compose.yml. If you're changing the name of the DB's container name (DB_CONT_NAME further down), you need to set this variable to match that name too.
dbHost=db

# ---------------------------------------------------------------------------------------------

# If you are not a developer ignore the following parameters: you will never need them.

# Where shall we store the backend and frontend code files.
codedir=./librephotos/code

Please provide additional information:

logs.zip

derneuere commented 2 days ago

This should be fixed in the latest release. Please pull the new version of the container and restart them :)