hooram / ownphotos

Self hosted alternative to Google Photos
MIT License
2.77k stars 233 forks source link

Cannot login after fresh install through docker-compose #104

Closed jbtruffault closed 5 years ago

jbtruffault commented 5 years ago

Hi everyone !

I'm facing the following error just after ownphotos installation through the following docker-compose:


version: '2'

services:

  ownphotos_db:
    image: postgres
    container_name: ownphotos_db
    restart: always
    environment:
    # This db password is internal, you can change it if you want, but also change it in ownphotos-backend container
      - POSTGRES_PASSWORD=db_pass
      - POSTGRES_DB=ownphotos
    volumes:
      - ownphotos-data:/var/lib/postgresql/data
    networks:
      - docker-bridge

  ownphotos_frontend:
    container_name: ownphotos_frontend
    image: guysoft/ownphotos-frontend:dev
    tty: true
    environment:
       # This is the path to the backend host public facing. if your website is ownphotos.org then this should be "ownphotos.org".
       # Default here is assuming you are running on localhost on port 3000 as given in ownphotos-proxy service
       - BACKEND_HOST=my.url.com
    links:
      - "ownphotos_backend"
    networks:
      - docker-bridge

  ownphotos_backend:
    image: hooram/ownphotos:dev
    container_name: ownphotos_backend
    volumes:
      # Your photos go here
      - $HOME/Pictures/:/data
      - $HOME/ownphotos_media:/code/protected_media
    environment:
      - SECRET_KEY=change_meme
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=ownphotos_backend
      - ADMIN_EMAIL=mymail@gmail.com
      - ADMIN_USERNAME=myname
      # Change your admin password!
      - ADMIN_PASSWORD=admin
      - DEBUG=false
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=postgres
      # This db password is internal, you can change it if you want, but also change it in ownphotos-db container
      - DB_PASS=db_pass
      - DB_HOST=ownphotos_db
      - DB_PORT=5432
      - REDIS_HOST=ownphotos_redis
      - REDIS_PORT=6379
      - MAPBOX_API_KEY=my_api_key
      - TIME_ZONE=UTC
    links:
      - "ownphotos_db"
      - "ownphotos_redis"
    networks:
      - docker-bridge

  ownphotos_redis:
    image: redis
    container_name: ownphotos_redis
    networks:
      - docker-bridge

networks:
  docker-bridge:
    external:
      name: br0

volumes:
  ownphotos-data: ~
  media: ~

I have my own nginx reverse-proxy, that is the reason why I removed the ownphotos-proxy.

Just after a login try, I get this error screen:

Sélection_014

Does anyone would have an idea of what is going on ?

Thanks !

guysoft commented 5 years ago

Dont remove ownphotos-proxy. It routes between the frontend and backend.

jbtruffault commented 5 years ago

I don't know if this can be the pb, I do thee routing with my own nginx instance, just rewrote the ownphoto proxy conf:

server{
        listen 443 ssl;
        server_name my_url;

        index index.html index.php;

        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        send_timeout 600;

        client_max_body_size 1024m;

        location / {
                proxy_pass http://ownphotos_frontend:3000;
                include /etc/nginx/proxy_params;
        }

        location /api {
                proxy_pass http://ownphotos_backend/api;
                include /etc/nginx/proxy_params;
        }

        location /media {
                proxy_pass http://ownphotos_backend/media;
                include /etc/nginx/proxy_params;
        }

    ssl_certificate /etc/letsencrypt/live/my_url/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/my_url/privkey.pem; # managed by Certbot
}
jbtruffault commented 5 years ago

The issues came from a wrong way to restart my docker-compose: I should delete all my volumes as I changed the docker-compose.yml file after build it a first time

The magic command was:

docker-compose down --volumes --remove-orphans; docker-compose up -d

guysoft commented 5 years ago

Thanks for updating the fix