LibrePhotos / librephotos

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

Integrating with Jwilder Nginx Reverse Proxy #82

Closed jorge-aparicio closed 3 years ago

jorge-aparicio commented 3 years ago

Hello,

I am really hoping someone can help me figure out how to setup librephotos with JWilders Nginx Proxy for docker. It has been really easy to get multiple other services up and running, but librephotos is giving me a hard time specifically, which I think is because librephotos already utilizes a proxy but I might be wrong. Anyways here is all the information I can supply from my test setup using on self-signed certs.

docker-compose.yml

version: '3'

services:
  proxy:
    image: reallibrephotos/librephotos-proxy:dev
    tty: true
    container_name: librephotos-proxy
    restart: always
    ports:
      - "3000:80"
    environment:
      - VIRTUAL_HOST=test.servhostname.local
    networks:
      - proxy-tier
      - default

  librephotos-db:
    image: postgres
    container_name: librephotos-db
    restart: always
    environment:
    # This db password is internal, you can change it if you want, but also change it in librephotos-backend container
      - POSTGRES_USER=docker
      - POSTGRES_PASSWORD=hstrhstrhsrththM
      - POSTGRES_DB=ownphotos
    volumes:
      - $HOME/librephotos_data:/var/lib/postgresql/data
    command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d ownphotos -U docker"]
      interval: 5s
      timeout: 5s
      retries: 5

  frontend:
    image: reallibrephotos/librephotos-frontend:dev
    # For development uncomment the "build" line below and comment the "image" line above
    # build: ../librephotos-frontend
    container_name: librephotos-frontend
    restart: always
    tty: true

  backend:
    image: reallibrephotos/librephotos:dev
    # For development uncomment the "build" line below and comment the "image" line above
    # build: .
    container_name: librephotos-backend
    restart: always
    volumes:
      - /media/librep/photos/:/data # CHANGE ME
      - /media/librep/librephotos_media/:/code/protected_media # CHANGE ME
      - /media/librep/librephotos_logs/:/code/logs # CHANGE ME
      - /media/librep/librephotos_cache/:/root/.cache # CHANGE ME
    environment:
      - SECRET_KEY=secret
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=example@email.com
      - ADMIN_USERNAME=jadmin
      # Change your admin password!
      - ADMIN_PASSWORD=admin
      - DEBUG=true
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=docker
      # This db password is internal, you can change it if you want, but also change it in librephotos-db container
      - DB_PASS=555555555555555555
      - DB_HOST=librephotos-db
      - DB_PORT=5432
      - REDIS_HOST=librephotos-redis
      - REDIS_PORT=6379
      # https://account.mapbox.com/auth/signup/
      - MAPBOX_API_KEY= # CHANGE ME - You need this for reverse photo geocoding
      # https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-TIME_ZONE
      - TIME_ZONE=America/Los_Angeles
      # The number of Gunicorn worker processes: set it up to (2*cpu cores). Each worker needs 800MB of RAM
      - WEB_CONCURRENCY=8 # CHANGEME
      # Gunicorn worker timeout seconds (ensure that one bad request doesn't stall other requests forever)
      - WORKER_TIMEOUT=1800
    links:
      - "librephotos-db:librephotos-db"
      - "librephotos-redis:librephotos-redis"
    # Wait for Postgres
    depends_on:
      - librephotos-db

  librephotos-redis:
    image: redis
    container_name: librephotos-redis
    restart: always

  proxy:
    image: jwilder/nginx-proxy:alpine
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - certs:/etc/nginx/certs:ro
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy-tier
    depends_on:
      - omgwtfssl

  omgwtfssl:
    image: paulczar/omgwtfssl
    restart: "no"
    volumes:
      - certs:/certs
    environment:
      - SSL_SUBJECT=servhostname.local
      - CA_SUBJECT=my@example.com
      - SSL_KEY=/certs/servhostname.local.key
      - SSL_CSR=/certs/servhostname.local.csr
      - SSL_CERT=/certs/servhostname.local.crt
    networks:
      - proxy-tier

volumes:
  certs:
  vhost.d:
  html:

networks:
  proxy-tier:

docker ps output:

CONTAINER ID   IMAGE                                      COMMAND                  CREATED             STATUS                   PORTS                                      NAMES
b53ace0d31c1   reallibrephotos/librephotos:dev            "/bin/sh -c ./entryp…"   6 minutes ago       Up 6 minutes             80/tcp                                     librephotos-backend
f70e23c877c1   postgres                                   "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes (healthy)   5432/tcp                                   librephotos-db
a35cb3723187   jwilder/nginx-proxy:alpine                 "/app/docker-entrypo…"   15 minutes ago      Up 15 minutes            0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   librephotos_proxy_1
d660017b8bb6   reallibrephotos/librephotos-frontend:dev   "/bin/sh -c ./run.sh"    About an hour ago   Up 47 minutes            3000/tcp                                   librephotos-frontend
8d45cfe1f730   redis                                      "docker-entrypoint.s…"   About an hour ago   Up 47 minutes            6379/tcp                                   librephotos-redis

startup log:

librephotos-db       | The files belonging to this database system will be owned by user "postgres".
librephotos-db       | This user must also own the server process.
librephotos-db       | 
librephotos-db       | The database cluster will be initialized with locale "en_US.utf8".
librephotos-db       | The default database encoding has accordingly been set to "UTF8".
librephotos-db       | The default text search configuration will be set to "english".
librephotos-db       | 
librephotos-db       | Data page checksums are disabled.
librephotos-db       | 
librephotos-db       | fixing permissions on existing directory /var/lib/postgresql/data ... ok
librephotos-backend  |  * Restarting nginx nginx
librephotos-db       | creating subdirectories ... ok
librephotos-db       | selecting dynamic shared memory implementation ... posix
omgwtfssl_1          | ----------------------------
omgwtfssl_1          | | OMGWTFSSL Cert Generator |
omgwtfssl_1          | ----------------------------
omgwtfssl_1          | 
librephotos-db       | selecting default max_connections ... 100
librephotos-db       | selecting default shared_buffers ... 128MB
librephotos-db       | selecting default time zone ... Etc/UTC
omgwtfssl_1          | Generating new config file openssl.cnf
librephotos-db       | creating configuration files ... ok
omgwtfssl_1          | --> Certificate Authority
librephotos-db       | running bootstrap script ... ok
librephotos-redis    | 1:C 02 Jan 2021 05:55:26.637 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
librephotos-redis    | 1:C 02 Jan 2021 05:55:26.637 # Redis version=6.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
librephotos-redis    | 1:C 02 Jan 2021 05:55:26.637 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
librephotos-redis    | 1:M 02 Jan 2021 05:55:26.638 * Running mode=standalone, port=6379.
librephotos-redis    | 1:M 02 Jan 2021 05:55:26.638 # Server initialized
librephotos-redis    | 1:M 02 Jan 2021 05:55:26.638 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
librephotos-redis    | 1:M 02 Jan 2021 05:55:26.638 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
librephotos-redis    | 1:M 02 Jan 2021 05:55:26.638 * Ready to accept connections
librephotos-redis    | 1:signal-handler (1609567990) Received SIGTERM scheduling shutdown...
librephotos-redis    | 1:M 02 Jan 2021 06:13:11.066 # User requested shutdown...
librephotos-redis    | 1:M 02 Jan 2021 06:13:11.066 * Saving the final RDB snapshot before exiting.
librephotos-redis    | 1:M 02 Jan 2021 06:13:11.068 * DB saved on disk
librephotos-redis    | 1:M 02 Jan 2021 06:13:11.069 # Redis is now ready to exit, bye bye...
librephotos-redis    | 1:C 02 Jan 2021 06:14:08.468 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
librephotos-redis    | 1:C 02 Jan 2021 06:14:08.468 # Redis version=6.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
librephotos-redis    | 1:C 02 Jan 2021 06:14:08.468 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.469 * Running mode=standalone, port=6379.
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.469 # Server initialized
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.469 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.469 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.470 * Loading RDB produced by version 6.0.9
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.470 * RDB age 57 seconds
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.470 * RDB memory usage when created 0.77 Mb
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.470 * DB loaded from disk: 0.000 seconds
librephotos-redis    | 1:M 02 Jan 2021 06:14:08.470 * Ready to accept connections
librephotos-redis    | 1:signal-handler (1609568238) Received SIGTERM scheduling shutdown...
librephotos-redis    | 1:M 02 Jan 2021 06:17:18.439 # User requested shutdown...
librephotos-redis    | 1:M 02 Jan 2021 06:17:18.439 * Saving the final RDB snapshot before exiting.
librephotos-redis    | 1:M 02 Jan 2021 06:17:18.441 * DB saved on disk
librephotos-redis    | 1:M 02 Jan 2021 06:17:18.441 # Redis is now ready to exit, bye bye...
librephotos-redis    | 1:C 02 Jan 2021 06:17:25.451 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
librephotos-redis    | 1:C 02 Jan 2021 06:17:25.451 # Redis version=6.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
librephotos-redis    | 1:C 02 Jan 2021 06:17:25.451 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.452 * Running mode=standalone, port=6379.
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.452 # Server initialized
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.452 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.452 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.453 * Loading RDB produced by version 6.0.9
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.453 * RDB age 7 seconds
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.453 * RDB memory usage when created 0.77 Mb
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.453 * DB loaded from disk: 0.000 seconds
librephotos-redis    | 1:M 02 Jan 2021 06:17:25.453 * Ready to accept connections
omgwtfssl_1          | ====> Using existing CA Key ca-key.pem
proxy_1              | WARNING: /etc/nginx/dhparam/dhparam.pem was not found. A pre-generated dhparam.pem will be used for now while a new one
proxy_1              | is being generated in the background.  Once the new dhparam.pem is in place, nginx will be reloaded.
proxy_1              | Generating DSA parameters, 4096 bit long prime
proxy_1              | forego     | starting dockergen.1 on port 5000
proxy_1              | forego     | starting nginx.1 on port 5100
proxy_1              | dockergen.1 | 2021/01/02 06:49:21 Generated '/etc/nginx/conf.d/default.conf' from 5 containers
proxy_1              | dockergen.1 | 2021/01/02 06:49:21 Running 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:49:21 Watching docker events
proxy_1              | dockergen.1 | 2021/01/02 06:49:21 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | 2021/01/02 06:49:24 [notice] 67#67: signal process started
proxy_1              | dhparam generation complete, reloading nginx
proxy_1              | dockergen.1 | 2021/01/02 06:50:12 Received event start for container 9ea8c5c33d29
proxy_1              | dockergen.1 | 2021/01/02 06:50:12 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:50:12 Received event die for container 9ea8c5c33d29
proxy_1              | dockergen.1 | 2021/01/02 06:50:12 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:57:58 Received event die for container 5a43d0a6a035
proxy_1              | dockergen.1 | 2021/01/02 06:57:58 Received event stop for container 5a43d0a6a035
proxy_1              | dockergen.1 | 2021/01/02 06:57:58 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Received event start for container 906b0a61fc0e
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Received event start for container f70e23c877c1
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Received event die for container 906b0a61fc0e
proxy_1              | dockergen.1 | 2021/01/02 06:57:59 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:58:09 Received event die for container b8fc3461bf65
proxy_1              | dockergen.1 | 2021/01/02 06:58:09 Received event stop for container b8fc3461bf65
proxy_1              | dockergen.1 | 2021/01/02 06:58:09 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:58:09 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2021/01/02 06:58:10 Received event start for container b53ace0d31c1
proxy_1              | dockergen.1 | 2021/01/02 06:58:10 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
omgwtfssl_1          | ====> Using existing CA Certificate ca.pem
omgwtfssl_1          | --> Certificate Authority
librephotos-frontend | serving frontend
librephotos-frontend | ERROR: Cannot copy to clipboard: write EPIPE
librephotos-frontend | 
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   Serving!                                     ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   - Local:            http://localhost:3000    ���
librephotos-frontend |    ���   - On Your Network:  http://172.18.0.5:3000   ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend | 
librephotos-frontend | serving frontend
librephotos-frontend | ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input
librephotos-frontend | xsel: Can't open display: (null)
librephotos-frontend | : Inappropriate ioctl for device
librephotos-frontend | 
librephotos-frontend | 
librephotos-frontend | 
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   Serving!                                     ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   - Local:            http://localhost:3000    ���
librephotos-frontend |    ���   - On Your Network:  http://172.18.0.2:3000   ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend | 
librephotos-frontend | serving frontend
librephotos-frontend | ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input
librephotos-frontend | xsel: Can't open display: (null)
librephotos-frontend | : Inappropriate ioctl for device
librephotos-frontend | 
librephotos-frontend | 
librephotos-frontend | 
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   Serving!                                     ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ���   - Local:            http://localhost:3000    ���
librephotos-frontend |    ���   - On Your Network:  http://172.18.0.3:3000   ���
librephotos-frontend |    ���                                                ���
librephotos-frontend |    ������������������������������������������������������������������������������������������������������������������������������������������������������
librephotos-frontend | 
librephotos-db       | performing post-bootstrap initialization ... ok
librephotos-db       | syncing data to disk ... ok
librephotos-db       | 
librephotos-db       | 
librephotos-db       | Success. You can now start the database server using:
librephotos-db       | 
librephotos-db       |     pg_ctl -D /var/lib/postgresql/data -l logfile start
librephotos-db       | 
omgwtfssl_1          | ====> Using existing CA Key ca-key.pem
omgwtfssl_1          | ====> Using existing CA Certificate ca.pem
omgwtfssl_1          | ====> Generating new SSL KEY /certs/perceus.local.key
omgwtfssl_1          | Generating RSA private key, 2048 bit long modulus (2 primes)
librephotos-db       | initdb: warning: enabling "trust" authentication for local connections
librephotos-db       | You can change this by editing pg_hba.conf or using the option -A, or
librephotos-db       | --auth-local and --auth-host, the next time you run initdb.
librephotos-db       | waiting for server to start....2021-01-02 06:58:00.080 UTC [48] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
librephotos-db       | 2021-01-02 06:58:00.080 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
librephotos-db       | 2021-01-02 06:58:00.083 UTC [49] LOG:  database system was shut down at 2021-01-02 06:57:59 UTC
librephotos-db       | 2021-01-02 06:58:00.087 UTC [48] LOG:  database system is ready to accept connections
librephotos-db       |  done
librephotos-db       | server started
librephotos-db       | CREATE DATABASE
librephotos-db       | 
librephotos-db       | 
librephotos-db       | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
librephotos-db       | 
librephotos-db       | waiting for server to shut down....2021-01-02 06:58:00.316 UTC [48] LOG:  received fast shutdown request
librephotos-db       | 2021-01-02 06:58:00.316 UTC [48] LOG:  aborting any active transactions
librephotos-db       | 2021-01-02 06:58:00.318 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
librephotos-db       | 2021-01-02 06:58:00.318 UTC [50] LOG:  shutting down
librephotos-db       | 2021-01-02 06:58:00.325 UTC [48] LOG:  database system is shut down
librephotos-db       |  done
librephotos-db       | server stopped
librephotos-db       | 
librephotos-db       | PostgreSQL init process complete; ready for start up.
librephotos-db       | 
librephotos-db       | 2021-01-02 06:58:00.442 UTC [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
librephotos-db       | 2021-01-02 06:58:00.443 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
librephotos-db       | 2021-01-02 06:58:00.443 UTC [1] LOG:  listening on IPv6 address "::", port 5432
librephotos-db       | 2021-01-02 06:58:00.443 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
librephotos-db       | 2021-01-02 06:58:00.445 UTC [76] LOG:  database system was shut down at 2021-01-02 06:58:00 UTC
librephotos-db       | 2021-01-02 06:58:00.448 UTC [1] LOG:  database system is ready to accept connections
omgwtfssl_1          | ........................................................................+++++
omgwtfssl_1          | .........+++++
omgwtfssl_1          | e is 65537 (0x010001)
omgwtfssl_1          | ====> Generating new SSL CSR /certs/perceus.local.csr
omgwtfssl_1          | ====> Generating new SSL CERT /certs/perceus.local.crt
omgwtfssl_1          | Signature ok
omgwtfssl_1          | subject=CN = perceus.local
omgwtfssl_1          | Getting CA Private Key
omgwtfssl_1          | ====> Complete
omgwtfssl_1          | keys can be found in volume mapped to /certs
omgwtfssl_1          | 
omgwtfssl_1          | ====> Output results as YAML
omgwtfssl_1          | ---
omgwtfssl_1          | ca_key: |
omgwtfssl_1          |   -----BEGIN RSA PRIVATE KEY-----
omgwtfssl_1          |   -----END CERTIFICATE-----
omgwtfssl_1          | 
librephotos_omgwtfssl_1 exited with code 0
librephotos-backend  |    ...done.
librephotos-db       | 2021-01-02 06:58:16.761 UTC [108] ERROR:  relation "api_face" does not exist at character 336
librephotos-db       | 2021-01-02 06:58:16.761 UTC [108] STATEMENT:  SELECT "api_face"."id", "api_face"."photo_id", "api_face"."image", "api_face"."image_path", "api_face"."person_id", "api_face"."person_label_is_inferred", "api_face"."person_label_probability", "api_face"."location_top", "api_face"."location_bottom", "api_face"."location_left", "api_face"."location_right", "api_face"."encoding" FROM "api_face" INNER JOIN "api_photo" ON ("api_face"."photo_id" = "api_photo"."image_hash") WHERE "api_photo"."hidden" = false ORDER BY "api_face"."id" ASC
librephotos-db       | 2021-01-02 06:58:16.766 UTC [108] ERROR:  relation "api_albumdate" does not exist at character 168
librephotos-db       | 2021-01-02 06:58:16.766 UTC [108] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id" FROM "api_albumdate" ORDER BY "api_albumdate"."date" DESC
librephotos-db       | 2021-01-02 06:58:16.771 UTC [108] ERROR:  relation "api_albumdate" does not exist at character 280
librephotos-db       | 2021-01-02 06:58:16.771 UTC [108] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id", COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE "api_photo"."hidden" = false) AS "photo_count" FROM "api_albumdate" LEFT OUTER JOIN "api_albumdate_photos" ON ("api_albumdate"."id" = "api_albumdate_photos"."albumdate_id") LEFT OUTER JOIN "api_photo" ON ("api_albumdate_photos"."photo_id" = "api_photo"."image_hash") GROUP BY "api_albumdate"."id" HAVING COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE ("api_photo"."hidden" = false)) > 0 ORDER BY "api_albumdate"."date" DESC
librephotos-backend  | admin
librephotos-backend  |  [ ] 0001_initial
librephotos-backend  |  [ ] 0002_logentry_remove_auto_add
librephotos-backend  |  [ ] 0003_logentry_add_action_flag_choices
librephotos-backend  | api
librephotos-backend  |  [ ] 0001_initial
librephotos-backend  | auth
librephotos-backend  |  [ ] 0001_initial
librephotos-backend  |  [ ] 0002_alter_permission_name_max_length
librephotos-backend  |  [ ] 0003_alter_user_email_max_length
librephotos-backend  |  [ ] 0004_alter_user_username_opts
librephotos-backend  |  [ ] 0005_alter_user_last_login_null
librephotos-backend  |  [ ] 0006_require_contenttypes_0002
librephotos-backend  |  [ ] 0007_alter_validators_add_error_messages
librephotos-backend  |  [ ] 0008_alter_user_username_max_length
librephotos-backend  |  [ ] 0009_alter_user_last_name_max_length
librephotos-backend  |  [ ] 0010_alter_group_name_max_length
librephotos-backend  |  [ ] 0011_update_proxy_permissions
librephotos-backend  | contenttypes
librephotos-backend  |  [ ] 0001_initial
librephotos-backend  |  [ ] 0002_remove_content_type_name
librephotos-backend  | database
librephotos-backend  |  [ ] 0001_initial
librephotos-backend  |  [ ] 0002_auto_20190129_2304
librephotos-backend  | sessions
librephotos-backend  |  [ ] 0001_initial
librephotos-db       | 2021-01-02 06:58:22.703 UTC [117] ERROR:  relation "api_face" does not exist at character 336
librephotos-db       | 2021-01-02 06:58:22.703 UTC [117] STATEMENT:  SELECT "api_face"."id", "api_face"."photo_id", "api_face"."image", "api_face"."image_path", "api_face"."person_id", "api_face"."person_label_is_inferred", "api_face"."person_label_probability", "api_face"."location_top", "api_face"."location_bottom", "api_face"."location_left", "api_face"."location_right", "api_face"."encoding" FROM "api_face" INNER JOIN "api_photo" ON ("api_face"."photo_id" = "api_photo"."image_hash") WHERE "api_photo"."hidden" = false ORDER BY "api_face"."id" ASC
librephotos-db       | 2021-01-02 06:58:22.711 UTC [117] ERROR:  relation "api_albumdate" does not exist at character 168
librephotos-db       | 2021-01-02 06:58:22.711 UTC [117] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id" FROM "api_albumdate" ORDER BY "api_albumdate"."date" DESC
librephotos-db       | 2021-01-02 06:58:22.716 UTC [117] ERROR:  relation "api_albumdate" does not exist at character 280
librephotos-db       | 2021-01-02 06:58:22.716 UTC [117] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id", COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE "api_photo"."hidden" = false) AS "photo_count" FROM "api_albumdate" LEFT OUTER JOIN "api_albumdate_photos" ON ("api_albumdate"."id" = "api_albumdate_photos"."albumdate_id") LEFT OUTER JOIN "api_photo" ON ("api_albumdate_photos"."photo_id" = "api_photo"."image_hash") GROUP BY "api_albumdate"."id" HAVING COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE ("api_photo"."hidden" = false)) > 0 ORDER BY "api_albumdate"."date" DESC
librephotos-backend  | No changes detected
librephotos-db       | 2021-01-02 06:58:28.634 UTC [126] ERROR:  relation "api_face" does not exist at character 336
librephotos-db       | 2021-01-02 06:58:28.634 UTC [126] STATEMENT:  SELECT "api_face"."id", "api_face"."photo_id", "api_face"."image", "api_face"."image_path", "api_face"."person_id", "api_face"."person_label_is_inferred", "api_face"."person_label_probability", "api_face"."location_top", "api_face"."location_bottom", "api_face"."location_left", "api_face"."location_right", "api_face"."encoding" FROM "api_face" INNER JOIN "api_photo" ON ("api_face"."photo_id" = "api_photo"."image_hash") WHERE "api_photo"."hidden" = false ORDER BY "api_face"."id" ASC
librephotos-db       | 2021-01-02 06:58:28.637 UTC [126] ERROR:  relation "api_albumdate" does not exist at character 168
librephotos-db       | 2021-01-02 06:58:28.637 UTC [126] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id" FROM "api_albumdate" ORDER BY "api_albumdate"."date" DESC
librephotos-db       | 2021-01-02 06:58:28.640 UTC [126] ERROR:  relation "api_albumdate" does not exist at character 280
librephotos-db       | 2021-01-02 06:58:28.640 UTC [126] STATEMENT:  SELECT "api_albumdate"."id", "api_albumdate"."title", "api_albumdate"."date", "api_albumdate"."favorited", "api_albumdate"."location", "api_albumdate"."owner_id", COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE "api_photo"."hidden" = false) AS "photo_count" FROM "api_albumdate" LEFT OUTER JOIN "api_albumdate_photos" ON ("api_albumdate"."id" = "api_albumdate_photos"."albumdate_id") LEFT OUTER JOIN "api_photo" ON ("api_albumdate_photos"."photo_id" = "api_photo"."image_hash") GROUP BY "api_albumdate"."id" HAVING COUNT(DISTINCT "api_albumdate_photos"."photo_id") FILTER (WHERE ("api_photo"."hidden" = false)) > 0 ORDER BY "api_albumdate"."date" DESC
librephotos-backend  | Operations to perform:
librephotos-backend  |   Apply all migrations: admin, api, auth, contenttypes, database, sessions
librephotos-backend  | Running migrations:
librephotos-backend  |   Applying contenttypes.0001_initial... OK
librephotos-backend  |   Applying contenttypes.0002_remove_content_type_name... OK
librephotos-backend  |   Applying auth.0001_initial... OK
librephotos-backend  |   Applying auth.0002_alter_permission_name_max_length... OK
librephotos-backend  |   Applying auth.0003_alter_user_email_max_length... OK
librephotos-backend  |   Applying auth.0004_alter_user_username_opts... OK
librephotos-backend  |   Applying auth.0005_alter_user_last_login_null... OK
librephotos-backend  |   Applying auth.0006_require_contenttypes_0002... OK
librephotos-backend  |   Applying auth.0007_alter_validators_add_error_messages... OK
librephotos-backend  |   Applying auth.0008_alter_user_username_max_length... OK
librephotos-backend  |   Applying auth.0009_alter_user_last_name_max_length... OK
librephotos-backend  |   Applying api.0001_initial... OK
librephotos-backend  |   Applying admin.0001_initial... OK
librephotos-backend  |   Applying admin.0002_logentry_remove_auto_add... OK
librephotos-backend  |   Applying admin.0003_logentry_add_action_flag_choices... OK
librephotos-backend  |   Applying auth.0010_alter_group_name_max_length... OK
librephotos-backend  |   Applying auth.0011_update_proxy_permissions... OK
librephotos-backend  |   Applying database.0001_initial... OK
librephotos-backend  |   Applying database.0002_auto_20190129_2304... OK
librephotos-backend  |   Applying sessions.0001_initial... OK
librephotos-backend  | admin
librephotos-backend  |  [X] 0001_initial
librephotos-backend  |  [X] 0002_logentry_remove_auto_add
librephotos-backend  |  [X] 0003_logentry_add_action_flag_choices
librephotos-backend  | api
librephotos-backend  |  [X] 0001_initial
librephotos-backend  | auth
librephotos-backend  |  [X] 0001_initial
librephotos-backend  |  [X] 0002_alter_permission_name_max_length
librephotos-backend  |  [X] 0003_alter_user_email_max_length
librephotos-backend  |  [X] 0004_alter_user_username_opts
librephotos-backend  |  [X] 0005_alter_user_last_login_null
librephotos-backend  |  [X] 0006_require_contenttypes_0002
librephotos-backend  |  [X] 0007_alter_validators_add_error_messages
librephotos-backend  |  [X] 0008_alter_user_username_max_length
librephotos-backend  |  [X] 0009_alter_user_last_name_max_length
librephotos-backend  |  [X] 0010_alter_group_name_max_length
librephotos-backend  |  [X] 0011_update_proxy_permissions
librephotos-backend  | contenttypes
librephotos-backend  |  [X] 0001_initial
librephotos-backend  |  [X] 0002_remove_content_type_name
librephotos-backend  | database
librephotos-backend  |  [X] 0001_initial
librephotos-backend  |  [X] 0002_auto_20190129_2304
librephotos-backend  | sessions
librephotos-backend  |  [X] 0001_initial
 http://localhost:3000  librephotos-backend  | Running backend server...
librephotos-backend  | [2021-01-02 06:58:48 +0000] [244] [INFO] Starting gunicorn 20.0.4
librephotos-backend  | [2021-01-02 06:58:48 +0000] [244] [INFO] Listening at: http://0.0.0.0:8001 (244)
librephotos-backend  | [2021-01-02 06:58:48 +0000] [244] [INFO] Using worker: gevent
librephotos-backend  | [2021-01-02 06:58:48 +0000] [248] [INFO] Booting worker with pid: 248
librephotos-backend  | [2021-01-02 06:58:48 +0000] [249] [INFO] Booting worker with pid: 249
librephotos-backend  | [2021-01-02 06:58:48 +0000] [261] [INFO] Booting worker with pid: 261
librephotos-backend  | [2021-01-02 06:58:48 +0000] [262] [INFO] Booting worker with pid: 262
librephotos-backend  | [2021-01-02 06:58:48 +0000] [263] [INFO] Booting worker with pid: 263
librephotos-backend  | [2021-01-02 06:58:48 +0000] [264] [INFO] Booting worker with pid: 264
librephotos-backend  | [2021-01-02 06:58:48 +0000] [265] [INFO] Booting worker with pid: 265
librephotos-backend  | [2021-01-02 06:58:48 +0000] [266] [INFO] Booting worker with pid: 266
librephotos-backend  | 06:58:56 Worker rq:worker:93a6b147b1b849ef9cc70e7286bde91d: started, version 1.6.1
librephotos-backend  | 06:58:56 Subscribing to channel rq:pubsub:93a6b147b1b849ef9cc70e7286bde91d
librephotos-backend  | 06:58:56 *** Listening on default...
librephotos-backend  | 06:58:56 Cleaning registries for queue: default

Thank you for any suggestions you could possibly provide!

rafntor commented 3 years ago

Your "docker ps" does not list "librephotos-proxy" - I think this is because you make two services with same name "proxy" and only the last one gets created, try unique service-names maybe?

Also, try to check the networks with:

docker network inspect librephotos_default
docker network inspect librephotos_proxy-tier

To see if the containers are connected to the networks the way you planned it to be ;-)

jorge-aparicio commented 3 years ago

Okay you were correct, I was able to get it up and running by renaming proxy to librephotos-proxy, as well as switching my port config from:

    ports:
      - 3000:80

to

    expose:
       - 80