For this generation of my website, I want to find a nice way to manage all my photos while distributing the highest quality photos possible -- after all getting a nice camera is to produce pictures to share with others.
I have kept the photos in .gitignore
forever but it is tricky when I want to
set up CICD to automate some of the tedious part of publishing photos. I had to
look into a LFS solution.
There doesn't seem to be much resource on self-hosting Git LFS on the Internet for some reason. I guess everyone just pay GitHub? But also 10 GiB isn't enough for all my photos.
When I looked at the
list of
open source Git LFS servers, there doesn't seem to be a commonly used one even.
The only viable option seems to be
git-lfs/lfs-test-server
-- the
official reference implementation in Go. Not the prettiest but should be able to
get things done.
Running things in Docker on Synology is quite easy. However, looking around
there doesn't seem to be an official Docker image at all despite having an
outdated
Dockerfile
in the repo.
Regardless, here is an improved version with a smaller runtime image:
FROM golang:1.23.9 AS build
WORKDIR /go/src/github.com/git-lfs/lfs-test-server
COPY . .
RUN go build
FROM debian:bookworm-slim
COPY --from=build /go/src/github.com/git-lfs/lfs-test-server/lfs-test-server /usr/bin/lfs-test-server
WORKDIR /data/lfs-server
EXPOSE 8080
CMD /usr/bin/lfs-test-server
This image is available on Docker Hub under fanzeyi/lfs-test-server
.
It's also quite convenient that lfs-test-server
takes configuration via
environment variables. Mount a data directory and it's ready to roll:
docker run \
-e LFS_ADMINUSER=admin \
-e LFS_ADMINPASS=admin \
-v $(PWD)/data:/data/lfs-server \
-p 8080:8080 fanzeyi/lfs-test-server
The last step is to just add an .lfsconfig
to my repo telling git-lfs
to use
my own server:
[lfs]
url = "http://synology:8080"