Open enboig opened 1 year ago
I just ran into this too - to fix, just change the third line of the Makefile:
The default case is include librephotos.env
.
To run with your own file, just change the name as required, e.g. change to include .env
to use your current .env
file for the renaming.
Actually, after fixing the above, I now have other issues:
frontend
container. I fixed this by manually changing the nginx.conf
file (has hard-coded frontend and backend names) and rebuilding the proxy container locally.File: https://github.com/LibrePhotos/librephotos-docker/blob/main/proxy/nginx.conf
Rebuild with: docker build -t proxy_archive --no-cache .
from the /proxy
directory to push local changes to the build. (Also the main docker-compose.yml file needs to be modified to use this local image, rather than the main repository image, change image: reallibrephotos/librephotos-proxy:${tag}
to image: proxy_archive
, at https://github.com/LibrePhotos/librephotos-docker/blob/01a4565ac8b1eee189438c3159776f1ad563daf6/docker-compose.yml#L13).
ALLOWED_HOST
, which also seems to be expecting backend
as the container name (my container is currently called backend_archive
).Error in logs:
backend_archive | django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'backend'. You may need to add 'backend' to ALLOWED_HOSTS.
This should be set from the ENV settings I think, see https://github.com/LibrePhotos/librephotos/blob/04ac679400c9424d122bd1d71f4012423526b3b3/librephotos/settings/production.py#L48
In the main docker-compose.yml
this should be configured:
environment:
- BACKEND_HOST=backend_archive
... but doesn't seem to be working for me at the moment. I'm now troubleshooting to see if I can find out where the issue is.
Nope, I never got it working correctly - I ended up just giving up on running multiple stacks, and just used multiple logins instead (although this has different issues!) :shrug:.
On Tue, Jun 18, 2024 at 11:12 AM rjdodd00 @.***> wrote:
I know this is old, but did this ever get resolved? I am having the same problem but on a fresh install
— Reply to this email directly, view it on GitHub https://github.com/LibrePhotos/librephotos-docker/issues/80#issuecomment-2176351382, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB5Z2WOITPRI6BS5NBA6OLZIBE7HAVCNFSM6AAAAAATCXPS2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWGM2TCMZYGI . You are receiving this because you commented.Message ID: @.***>
I borrowed the 'proxy' directory and used the following to solve the problem:
$(REPLACE_NAMES) proxy/nginx.raw > proxy/nginx.conf
build:
context: ./proxy
args:
tag: ${tag}
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
events { worker_connections 1024; }
http { server { listen 80;
location / {
# React routes are entirely on the App side in the web browser
# Always proxy to root with the same page request when nginx 404s
error_page 404 /;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_pass http://__frontend_name__:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Allow to download zip files directly. This has to go before the following rule
location ~ ^/api/downloads/(.*)$ {
root /;
try_files /protected_media/zip/$1.zip =404;
}
location ~ ^/(api|media)/ {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host __backend_name__;
include uwsgi_params;
proxy_pass http://__backend_name__:8001;
}
# needed for webpack-dev-server
location /ws {
proxy_pass http://__frontend_name__:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Django media
location /protected_media {
internal;
alias /protected_media/;
}
location /static/drf-yasg {
proxy_pass http://__backend_name__:8001;
}
location /data {
internal;
alias /data/;
}
# Original Photos
location /original {
internal;
alias /data/;
}
# Nextcloud Original Photos
location /nextcloud_original {
internal;
alias /data/nextcloud_media/;
}
} }
4. edit 'Dockerfile'
ARG tag FROM reallibrephotos/librephotos-proxy:${tag} COPY nginx.conf /etc/nginx/nginx.conf
5. run`sudo docker compose up --build -d`
I renamed containers name in
.env
and when I runmake rename
they aren't renamed indocker-compose.yml
. I renamed them manually indocker-compose.yml
but then if I runmake rename
they are overwrite. Could it be that.env
is not used?Reading
Makefile
file it appear it is usinglibrephotos.env
and not.env