waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
452 stars 71 forks source link

Docker error and questions #72

Closed salicius closed 1 year ago

salicius commented 1 year ago

Hi, I'm starting right now with docker so please forgive my ignorance. I have some questions:

1) I trying to start this docker image so with the terminal I used this commands: Screenshot 2023-03-17 at 12 22 13 PMbut then if I open my browser at localhost:8080 it shows nothing. Where am I going wrong?

2) To edit images files do I have to go to Docker Desktop -> Containers -> My Container -> Files and here create a folder named "original" ?

3) Without docker if I fork the repo and clone it locally with vscode how can I run it in my localhost ?

waschinski commented 1 year ago

Hi, thanks for checking out Photo Stream.

  1. You should map port 4000 like -p 4000:4000 and then open localhost:4000 in your browser on the same PC.
  2. With Docker you should look into volume mounts e.g. -v /your/local/folder/:/photo-stream/photos. Make sure there's a folder called original inside your local folder which contains the photos.
  3. When cloned (you don't need to fork just for checking it out) just run this command: bundle exec jekyll serve
salicius commented 1 year ago

Hi, thanks for checking out Photo Stream.

  1. You should map port 4000 like -p 4000:4000 and then open localhost:4000 in your browser on the same PC.
  2. With Docker you should look into volume mounts e.g. -v /your/local/folder/:/photo-stream/photos. Make sure there's a folder called original inside your local folder which contains the photos.
  3. When cloned (you don't need to fork just for checking it out) just run this command: bundle exec jekyll serve

Ok thank you, I added the folder "original" following the path I described in my point no. 2 (sorry I don't get how to "look into volume mounts" how you said):

Screenshot 2023-03-17 at 5 44 15 PM

but localhost shows all images with the broken thumbnail:

Screenshot 2023-03-17 at 5 41 49 PM
waschinski commented 1 year ago

I actually didn't know Docker Desktop allows to add files/folders like that. Anyway, your photos need to end up at /photo-stream/photos/original/ in your container.

I strongly advise you to read more about the docker run command though, especially about volumes.

salicius commented 1 year ago

Ok thanks, I'm trying to figure out how to access the volume to change the files inside it but it seems that on macOS Docker does not allow this directly (https://stackoverflow.com/questions/54886883/where-docker-volumes-are-located) and currently I can only do it through Docker Desktop.

waschinski commented 1 year ago

You don't need to use a volume, you can also mount an existing folder like that -v /Users/yourname/Desktop/photo-stream-photos/:/photo-stream/photos when starting the container.

salicius commented 1 year ago

Ok got it, thanks a lot!