timelinize / timelinize

Store your data from all your accounts and devices in a single cohesive timeline on your own computer
https://timelinize.com
GNU Affero General Public License v3.0
645 stars 19 forks source link

Make a Docker image #22

Closed mholt closed 2 months ago

mholt commented 2 months ago

I don't personally use Docker, but I can see how a project like this, which has external dependencies, would benefit from a Docker image.

For now, @rubiojr has shared Dockerfile here: https://github.com/timelinize/timelinize/issues/18#issuecomment-2286480658

Having an official one for the project might be a good idea. Anyone able to make one? Let me know what you need from the repo.

rubiojr commented 2 months ago

I'd be happy to fix/improve what I shared and contribute it to the repo, if a PR to add it to the root of the repo or some other place is desirable.

mholt commented 2 months ago

That would be wonderful if you are able to do that! :smiley: Maybe just a Dockerfile at the root then?

mbolli commented 2 months ago

In my setup, I put the git clone step and the removal of 127.0.0.1 in the Dockerfile as well:

# Use Arch Linux as the base image
FROM archlinux:latest

# Set the working directory inside the container
WORKDIR /app

# Install necessary dependencies
RUN pacman -Syu --noconfirm && \
    base-devel \
    git \
    go \
    libvips \
    ffmpeg \
    libheif

WORKDIR /app
EXPOSE 12002

# Clone the Timelinize repository
RUN git clone https://github.com/timelinize/timelinize.git /app
RUN sed -i 's/defaultAdminAddr = "127.0.0.1:12002"/defaultAdminAddr = ":12002"/' tlzapp/app.go

# Compile the Go binary
ENV CGO_ENABLED=1
RUN go build -o /app/timelinize

VOLUME /repos

CMD ["/app/timelinize", "serve"]

Works on my machine ;) Setup was flawless, timelinize already looks very promising!

rubiojr commented 2 months ago

@mbolli those were the changes I planed, beat me to the punch 🥊. Please feel free to open that PR!

mbolli commented 2 months ago

@rubiojr I can do it, although your approach (copying the current directory) probably makes more sense in the context of this repo? My approach is maybe better for a registry e.g. the Docker Hub?

rubiojr commented 2 months ago

@mbolli maybe yeah. If the intent is to publish to ghcr.io or dockerhub eventually and automatically using GH actions, using the local context/dir may be optimal (instead of cloning), since actions generally clone the repo and make it available before a docker build, so no need to do it again from within the Dockerfile.

mholt commented 2 months ago

I would be interested in having an image on Docker Hub, if anyone would like to contribute that. (Just let me know what you need.) GHCR is also an option I'd be okay with (or both if that's useful). I don't use Docker myself, so again, this would have to be something maintained by someone else. But if it's mostly automated, well 🤷‍♂️

But having a Dockerfile in this repo would also be a good idea, I think, for people who are cloning it down and want to dev on it and run it in a container.

rubiojr commented 2 months ago

Opened https://github.com/timelinize/timelinize/pull/26

rubiojr commented 2 months ago

@mholt do you think we should add more here (happy to take care of it), or should this be closed?

mholt commented 2 months ago

Oh, right -- I think we're good for now. If any Docker users want to iterate on our current work then we can do that in another issue/PR. Thanks!