Casvt / MIND

A simple self hosted reminder application that can send push notifications to your device. Set the reminder and forget about it!
https://casvt.github.io/MIND/
GNU General Public License v3.0
209 stars 10 forks source link

Docker container not working #24

Closed tiritibambix closed 1 year ago

tiritibambix commented 1 year ago

Hello.

I've been willing to see a tool like Noted Reminders for a while and I'm happy you worked on it.

I'm not a genius when it comes to computers, but I try my best.

I use Portainer as a GUI to manage my containers.

I tried copy-pasting and tweaking the provided docker-compose.yml (/srv/Files/Noted/noted-db:/app, TZ=Europe/Paris and ports 8008:8080) but I then ran into an error : python3: can't open file '/app/Noted.py': [Errno 2] No such file or directory

So I copied Noted.py from the repo to /srv/Files/Noted/noted-db:/app I ran into this error :

Traceback (most recent call last):
  File "/app/Noted.py", line 11, in <module>
    from backend.db import close_db, setup_db, DBConnection
ModuleNotFoundError: No module named 'backend'

I also tried cloning the whole repo in /srv/Files/Noted/noted-db and run the stack in portainer. While the logs say No log line matching the '' filter, I can access Noted, create an account, add a notification service for discord (discord://webhook_id/webhook_token), create a reminder, but I don't get any notification.

Finally, I tried cloning, editing docker-compose.yml and running docker compose up -d. Same as above: the logs say No log line matching the '' filter, I can access Noted, create an account, add a notification service for discord (discord://webhook_id/webhook_token), create a reminder, but I don't get any notification.

I also tried to input https://discord.com/api/webhooks/webhook_id/webhook_token because why not. It won't work.

What am I doing wrong ?

Casvt commented 1 year ago

I think it has to do with the volume mounting to /app. I'll see what I can do in a few hours:)

This is my first application with docker support so I'm learning too.

tiritibambix commented 1 year ago

I'd be glad to test and share the results :)

tiritibambix commented 1 year ago

[...]

For the docker setup documentation, maybe it should be worth mentioning that cloning the repo is necessary in order to build the app.

arvigeus commented 1 year ago

Just wanted to chime in to say I had the same issue with permissions.

tiritibambix commented 1 year ago

Just wanted to chime in to say I had the same issue with permissions.

What was your approach installing it in the end ?

arvigeus commented 1 year ago

Correction, I still have same issue.

   noted:
     image: mrcas/noted:latest
     hostname: noted
     container_name: noted
     restart: unless-stopped
     environment:
       - TZ=${TZ}
     volumes:
       - ${DATA}/noted/app:/app
tiritibambix commented 1 year ago

Correction, I still have same issue.

Did you try this ?

For the docker setup documentation, maybe it should be worth mentioning that cloning the repo is necessary in order to build the app.

arvigeus commented 1 year ago

I'll wait for official fix, no hurry

ItsNoted commented 1 year ago

The time is defined by the TZ environment variable. make sure to put TZ=Europe/Paris and try again.

If that does not work please check the time and date on the host using date and see if it matches. If not run the following command timedatectl set-timezone Europe/Paris

Use sudo if required.

Casvt commented 1 year ago

@tiritibambix your problem with getting your notification an hour late is a problem that should be fixed but is not related to the docker issue we have in the thread. Please make a new issue for the problem you're experiencing with getting notifications 1 hour late (timezone conflicts probably).

tiritibambix commented 1 year ago

I'll wait for official fix, no hurry

Cloning the repo could be the fix...

@tiritibambix your problem with getting your notification an hour late is a problem that should be fixed but is not related to the docker issue we have in the thread. Please make a new issue for the problem you're experiencing with getting notifications 1 hour late (timezone conflicts probably).

I will

Antoine2tt commented 1 year ago

I'm having the same issue.

Maybe @Casvt can upload your dockerfile to the repo so if you're having troubles maybe we can help you ?

Casvt commented 1 year ago

@antoine2tt

# syntax=docker/dockerfile:1

FROM python:3.8-slim-buster

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

CMD [ "python3", "/app/Noted.py" ]

I think it has to do with the fact that the volume is mounted at /app, where the whole project is also located. So those two mix and mess it up. That's what I think. If I change Noted to put the database in its own subfolder and make docker mount the volume in this subfolder, where only the db is located, I think it'll fix stuff

Casvt commented 1 year ago

Alright, I've made an updated version of the docker image. Please do the following and let me know how it goes:

docker run -d \
    --name noted \
    -v noted-db:/app/db \
    -e TZ=Europe/Amsterdam \
    -p 8080:8080 \
    mrcas/noted:v1.0.1-beta
Antoine2tt commented 1 year ago

Alright ! It's working now.

Just, i think that they're an issue with the docker logs, i have nothing when attached to the container

Casvt commented 1 year ago

@tiritibambix @arvigeus please let me know if it's also working for you now :)

tiritibambix commented 1 year ago

@tiritibambix @arvigeus please let me know if it's also working for you now :)

It's working great. Thank you :)

I'll wait for this to be implemented in the latest version but in the meantime I may close the issue

Casvt commented 1 year ago

@Antoine2tt, @arvigeus and @tiritibambix

V1.0.1 has been released, where the docker container is fixed and some timezone problems are fixed. mrcas/noted:latest will get you this new version now. Please note that the command to run the docker container has changed:

OLD:

docker run -d \
    --name noted \
    -v noted-db:/app \
    -e TZ=Europe/Amsterdam \
    -p 8080:8080 \
    mrcas/noted:latest

NEW:

docker run -d \
    --name noted \
    -v noted-db:/app/db \
    -e TZ=Europe/Amsterdam \
    -p 8080:8080 \
    mrcas/noted:latest