Coder Social home page Coder Social logo

fspoettel / linkding-on-fly Goto Github PK

View Code? Open in Web Editor NEW
57.0 2.0 12.0 12 KB

🔖 Run linkding on fly.io. Backup the bookmark DB to cloud storage with litestream.

License: MIT License

Dockerfile 69.85% Shell 30.15%
fly flyio linkding litestream self-hosted

linkding-on-fly's Introduction

Hey! ฅʕ ·͡ᴥ·ʔ ฅ

I'm Felix, a developer from Berlin interested in user interfaces, music and microcontrollers.

🌱 More on my website.
📮 Say hello.

linkding-on-fly's People

Contributors

dbrennand avatar fspoettel avatar jonhoffmam avatar robintw avatar sliponit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linkding-on-fly's Issues

Failure on fly.io

Hi, followed the guide exactly. After I deploy to fly.io and go to live logs i see that;

2024-03-27T14:54:52.830 app[3287965c063418] ... [info] ERROR Error: failed to spawn command: /scripts/run.sh: No such file or directory (os error 2)

[Request] Can you provide steps for fl0.com

I tried to use fly, but it is asking me to add card details even for 256MB machine,

so I am trying to imitate the same steps on fl0 - https://www.fl0.com
by setting the same environment variables in the fl0 machine on website, and using Dockerfile
but for some reason, it finishes the build but fails to deploy with Status Reason: CrashLoopBackoff

Could you please help? I have not used Dockerfile before so I am not sure why it is crashing
Thank you

Dockerfile
ARG APP_NAME=linkding
ARG ALPINE_IMAGE_TAG=3.14
ARG LINKDING_IMAGE_TAG=latest

FROM docker.io/alpine:$ALPINE_IMAGE_TAG as builder
ARG APP_NAME
ENV APP_NAME=$APP_NAME

ARG LITESTREAM_VERSION=v0.3.11
# Download the static build of Litestream directly into the path & make it executable.
# This is done in the builder and copied as the chmod doubles the size.
ADD https://github.com/benbjohnson/litestream/releases/download/$LITESTREAM_VERSION/litestream-$LITESTREAM_VERSION-linux-amd64.tar.gz /tmp/litestream.tar.gz
RUN tar -C /usr/local/bin -xzf /tmp/litestream.tar.gz

# Pull linkding docker image.
FROM docker.io/sissbruecker/linkding:$LINKDING_IMAGE_TAG
ARG APP_NAME
ENV APP_NAME=$APP_NAME
VOLUME /etc/linkding
VOLUME /etc/linkding/data
ENV DB_PATH="/etc/linkding/data/db.sqlite3"
ENV LD_SERVER_PORT="9090"
ENV LITESTREAM_REPLICA_PATH="linkding_replica.sqlite3"
ENV LITESTREAM_REPLICA_BUCKET="somename"
ENV LITESTREAM_REPLICA_ENDPOINT="someurl.backblazeb2.com"
# Copy Litestream from builder.
COPY --from=builder /usr/local/bin/litestream /usr/local/bin/litestream

# Copy Litestream configuration file.
COPY etc/litestream.yml /etc/litestream.yml

# Copy custom uwsgi. This allows to run with 256MB RAM.
COPY uwsgi.ini /etc/linkding/uwsgi.ini

# Copy startup script and make it executable.
COPY scripts/run.sh /scripts/run.sh
RUN chmod +x /scripts/run.sh

# Litestream spawns linkding's webserver as subprocess.
CMD ["/scripts/run.sh"]

Experience running on fly.io with 256MB

With 256MB RAM, there are frequent Out Of Memory (OOM) crashes. The idle RAM is about 220 MB.

Without further configuration, import via html file is okay as long as 300 bookmarks per file. More than that and it crashed with OOM.

For the mass import, I run the linkding in local docker and do the import. Then backup sqlite file (according to the documentation) and replace the sqlite file on fly.io. I have to restart the fly.io. The existing user and user from local import both works.

I followed the fly.io documentation to enable swap and it reduced idle RAM to 180MB.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.