Giter Club home page Giter Club logo

Comments (15)

rolandgeider avatar rolandgeider commented on August 13, 2024

Hi!

I would suggest changing the exposed port 80 to something that is free in your network and then using your already existing nginx to reverse proxy to it. If you want to only use one, you will need to make sure the volumes are mounted correctly and configure nginx so that it serves the static files.

As for the demo, it's supposed to be just a quick way to test the application without regards to performance or anything. Plus we're currently adding some celery workers to manage background tasks and that will probably only work correctly with this setup

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Hello and thanks for taking a look.

Which port 80 are you referring to? I've commented out the nginx section in docker-compose because I am already running Nginx Proxy Manager in a separate container. The only exposed ports I have are 5432 for db and 6379 cache.

I'm still running into the error even without a reverse proxy and accessing via http://IP:PORT. Do you have any other suggestions I can try to get wger up and running?

I'm new to all of this, so appreciate your patience.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

you can change the port exposed to the outside from 80 to something else, like 8080 in the nginx block, where it says ports so it looks like "8080:80" (line 38). That's the only thing that you'd need to change, the other two are for the db and cache and are only used internally within the containers so they are not accessible from the outside.

Then you can just take your existing nginx and add a map to the IP where the wger containers are running and port 8080 (or whatever else you chose)

I hope this helps 🤞🏻

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Is the nginx section of the docker-compose required for wger to work? I thought I'd be able to delete it entirely since I have a separate Nginx Proxy Manager setup, or if I wanted to run it LAN-only and access via http://PORT:IP.

When I enable the nginx section and change the external port as suggested, I get different errors when starting the container:

DoesNotExist at /en/software/features

Language matching query does not exist.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

yeah, it's needed. I mean, you could probably make yours work with it, but it will be some work (but it should be possible in theory), "our" nginx isn't only a reverse proxy to the application, it also serves the static files.

As for the error message, I'm guessing there was something wrong when the containers first started. Can you delete all volumes and start again?

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Found the issue. wger was connected to a Docker bridge network with other containers, and for some reason wger db commands were being routed to the postgres of another container/service. Why would this happen?

Doing the following got wger working:

  • Remove wger from Docker bridge network and isolate in its own Docker network
  • Setup Nginx Proxy Manager to access via wger.mydomain.tld. When trying to access wger via http://IP:PORT alone, only text is displayed with no images and wger doesn't fully work

Thanks for your patience and help. I wouldn't have figured out how to get this running otherwise.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

ugh alright, I wouldn't have guessed it was that 😅

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

so does the app correctly load the css and js files when accessing it over the domain?

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Looks like I spoke too soon 😅

Accessing over the domain loads the main wger welcome page, but the service itself is not fully functioning. For example, once logged in as admin, I cannot bring up the drop down menu in the top right to add users or logout. The wger logo is also missing from the top left.

Checking the wger_nginx logs show errors like this one:

2022/11/06 21:06:42 [error] 30#30: *1698 open() "/wger/static/images/icons/flag-nl.svg" failed (2: No such file or directory), client: 172.16.16.1, server: , request: "GET /static/images/icons/flag-nl.svg HTTP/1.1", host: "wger.mydomain.tld", referrer: "https://wger.mydomain.tld/en/dashboard"

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

Looks like I spoke too soon 😅

I know that feeling!

So some of the css/images arebeing loaded correctly and others are not? 🤔 That would be a new one.

BTW, how did you configure the network?

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Yes it looks like some assets are loaded correctly, but others are not and showing errors in logs.

In my docker-compose:
web port left at 8000
nginx changed to 84:80 (84 is not a conflict with any other Docker service ports)
db port left at 5432
cache port left at 6379

wger is completely isolated in its own Docker network wger_default

Nginx Reverse Proxy manager is set to pass wger.mydomain.tld to http://192.168.1.15:84 (local server IP and wger port). This is a LAN-only reverse proxy.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

That's really strange. Perhaps you can drop the volume used for the static files and start again. There's a step in the boot process where the files are copied over, there might be some error message there

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Hello again. I dropped the volumes and started over, but am still seeing text-only without any of the static images.

wger_server logs are below, and I don't see any step where the files are copied over:

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 4.95s.
yarn run v1.22.19
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
Done in 2.22s.
Set site URL to http://localhost:8000
Using gunicorn...
[2023-01-08 19:57:19 +0000] [57] [INFO] Starting gunicorn 20.1.0
[2023-01-08 19:57:19 +0000] [57] [INFO] Listening at: http://0.0.0.0:8000 (57)
[2023-01-08 19:57:19 +0000] [57] [INFO] Using worker: sync
[2023-01-08 19:57:19 +0000] [58] [INFO] Booting worker with pid: 58

/home/wger/static in the wger_server container is also empty with no files.

from docker.

zero-thermo avatar zero-thermo commented on August 13, 2024

Figured it out: need to change DJANGO_DEBUG back to False in prod.env

Looking forward to using wger. Thanks for your continued work on this project.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

FYI, when setting debug to true, you are using django's dev server. While this will work fine, it is not meant to be used for production (in case you get some unusually high memory usage or stuff like that).

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.