Closed Ronald-Diemicke closed 8 months ago
the docker compose files are right there, including an image on docker hub if you use something like portainer, setup a 'stack', import the yml and .env file etc if your partition with docker images is small, there's a path where the images are stored you can mount outside of the container
@axewater - can you point me toward the image on docker hub? I found two; one is outdated, the other doesn't seem to work?...
nm - found kapitanczarnobrod/sharewarez:1.1.0 which seems to be yours... but getting this in unraid:
/app/entrypoint.sh: 7: /app/entrypoint.sh: cannot open database_host: No such file /app/entrypoint.sh: 7: /app/entrypoint.sh: psql: not found Traceback (most recent call last): File "/app/docker_adduser.py", line 100, in <module> create_admin_user(DATABASE_URI) File "/app/docker_adduser.py", line 59, in create_admin_user if not check_postgres_port_open(parsed_uri.hostname, parsed_uri.port or 5432): File "/app/docker_adduser.py", line 47, in check_postgres_port_open with socket.create_connection((host, port), timeout=10): File "/usr/local/lib/python3.9/socket.py", line 823, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -5] No address associated with hostname Traceback (most recent call last): File "/app/app.py", line 4, in <module> app = create_app() File "/app/modules/__init__.py", line 60, in create_app check_postgres_port_open(parsed_url.hostname, 5432, 60, 2); File "/app/modules/__init__.py", line 41, in check_postgres_port_open with socket.create_connection((host, port), timeout=10): File "/usr/local/lib/python3.9/socket.py", line 823, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -5] No address associated with hostname SharewareZ container strapping boots PostgreSQL is now available.
Looking at the code a bit and these errors... I suspect this is because it's expecting an external postgres database ... I was thinking this was built into the container, but I guess not.
Yes v1. 1.0 is the latest. The postgresql docker is included via the docker-compose.yml file. It's 2 images that work together and the compose file does that. Try it this way, first it clone the repo, docker-compose build docker-compose up
Interesting... so unraid just you just point it at the dockerhub image and it goes...
I'll continue messing with it to see if I can get it to work.
Also - would it be possible for you to tag the latest version with the 'latest' tag as well?
So I tried this locally rather than through unraid:
SharewareZ container strapping boots
PostgreSQL is now available.
/app/entrypoint.sh: 7: cannot open database_host: No such file
Traceback (most recent call last):
File "/app/docker_adduser.py", line 8, in
WARN[0000] The "SHAREWAREZ_USERNAME" variable is not set. Defaulting to a blank string. WARN[0000] The "SHAREWAREZ_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_DB" variable is not set. Defaulting to a blank string. WARN[0000] The "DATA_FOLDER_WAREZ" variable is not set. Defaulting to a blank string. WARN[0000] The "DATA_FOLDER_IMAGEZ" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_DB" variable is not set. Defaulting to a blank string. invalid spec: :/storage: empty section between colons
WARN[0000] The "SHAREWAREZ_USERNAME" variable is not set. Defaulting to a blank string. WARN[0000] The "SHAREWAREZ_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_DB" variable is not set. Defaulting to a blank string. WARN[0000] The "DATA_FOLDER_WAREZ" variable is not set. Defaulting to a blank string. WARN[0000] The "DATA_FOLDER_IMAGEZ" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "POSTGRES_DB" variable is not set. Defaulting to a blank string. invalid spec: :/storage: empty section between colons
Note that to get this to even get to this point, I needed to update the dockerfile: from: FROM python:3.9-slim-buster
to: FROM python:latest
wow I dont understand why Unraid is so different. I have tested it on Windows, Ubuntu, QNAP NAS (a little more tricky, but works), using docker, without docker. Ronald if you are Dutch we can setup a remote session to debug.
No worries... I think I figured our why this was being dumb... or rather why I was being dumb... I never updated the .env.example to .env
when in your last attempt, you ran the docker seperately, did you provide it an .env file ? there is a list of settings it needs, like where you are putting the database, and your IGDB API keys. when you run the app like a Python app, it uses config.py, when running a docker it will look for .env or the variables in your environment. all of this is on the readme. Just because you use the docker, doesnt mean it doesnt require any config.
we came to the same conclusion ! pls let me know if it all works on Unraid
So - I'm getting closer....
in addition to updating the dockerfile; I packaged the dockerhub image with a .env and set the tag to 'latest'
https://hub.docker.com/repository/docker/tex8503/sharewarez/general
The reason this is important is that if an image isn't build specifically for unraid in the community applications store; you can import a dockerhub image and it tries to auto set it up.
However, to do this, it pulls the image first with the latest tag and looks for the .env to see what variables you should allow to be configured.
Pulling the dockerhub image I created is getting me a bit further in unraid, however, now I'm getting this in the log:
exec /usr/bin/sh: exec format error
that error would point to an architechtural difference. meaning the image was meant for x86 and you have ARM processor or something else. In that case you need to build an image yourself.
git clone https://github.com/axewater/sharewarez cd sharewarez (create your .env file) python -m venv venv source venv/bin/activate
docker-compose build docker-compose up
that should install and run the SQL server and APP on your box and run them combined NB: its possible on your system the command is 'docker compose' without the - dash
Ok - I was able to get docker-compose to work locally on my M1 Mac.
However, Unraid continues to balk at this and reading up a bit, it seems like it just doesn't like docker-compose either
But I suspect my image isn't happy because I'm on an M1 Mac and the unraid box is x86
hmm it might be a problem with one of the libraries, psycopg2-binary its a weird library .. I think its precompiled binary .. maybe if you find a Mac M1 version of that, pip install that snazzlejazzle
Ok - I finally got this to work...
Here's what I did:
One quick additional note that it took me a hot min to figure out: compose manager by default wants to write it's files to /boot/config/plugins/compose.manager which seemed to be causing the DB an issue (I'm assuming permissions related since the DB got stuck in a restart loop since it couldn't create it's files) ; so I repointed this to /mnt/user/appdata/compose.manager - Postgres seemed a lot happier about this and it all just worked.
Cool idea... Would love to see a containerized version of this for Unraid!