GithubHelp home page GithubHelp logo

Comments (5)

LeoColomb avatar LeoColomb commented on July 17, 2024

Thanks for filing this issue, @Svampebob1.
Indeed, per default, a container data is not persistent and therefore lost when recreated. This is true for YOURLS configuration.
To keep the configuration, a volume must be created to store the config data into a persistent storage.
In our case, a volume on /var/www/html/user/config.php. In fact, it might be useful/simpler to mount the whole user folder, /var/www/html/user.

The update is blocked when the entire YOURLS location is mounted, /var/www/html, to avoid file mismatch.

I'm closing the issue as answered, but don't hesitate to continue the discussion below is needed.

from images.

Svampebob1 avatar Svampebob1 commented on July 17, 2024

I'm sorry, but I've lost all my short URLs again. I see that there has been an update two days ago.
I'm using watchtower for automatic updates. I've disabled this for this image, until I've found a solution.

What is the best practice on upgrading this image, without data?
I'm thinking about taking regular backups, so that I can restore when this happens the next time.
In case of backup and restore, where are the short URLs stored?

from images.

LeoColomb avatar LeoColomb commented on July 17, 2024

What is the best practice on upgrading this image, without data?

First you must elaborate on which data you are talking about:

  • As of your original report, you were talking about configuration data. The way to handle the configuration has been described in my previous answer.
  • Now you are mentionning the lost of application data, i.e. actual links, which are stored on a external database. By external, it mease this database is independant of YOURLS, thus not affected by YOURLS updates.
    Please refer to this database documentation on how to handle it properly. If you are using MySQL, see its container usage documentation here: https://hub.docker.com/_/mysql

from images.

Svampebob1 avatar Svampebob1 commented on July 17, 2024

Sorry. It was supposed to be "without loosing data". To be more specific: Without loosing my short URLs.

I've been using the example for docker compose from Docker hub. But I understand the problem now. I've been assuming that the short URLs has been stored as a file and logons has been stored in the database. But I see now that this is a completely wrong assumption.

Thanks for your help 👍️.

from images.

Svampebob1 avatar Svampebob1 commented on July 17, 2024

To anyone else having the same issue, you can use the following Docker compose template for setting up Yourls:

version: '3.1'

services:

  yourls:
	image: yourls
	restart: always
	volumes:
	  - /--path-to-yourls--/yourls/user:/var/www/html/user   
	ports:
	  - 8083:80
	environment:
	  YOURLS_DB_PASS: --root DB password--
	  YOURLS_SITE: https://--url for yourls--
	  YOURLS_USER: --login user--
	  YOURLS_PASS: --login password--
	depends_on:
	  - mysql

  mysql:
	image: mysql
	restart: always
	environment:
	  MYSQL_ROOT_PASSWORD: --root DB password--
	  MYSQL_DATABASE: yourls
	volumes:
	  - /--path to yourls--/yourls/mysql-data:/var/lib/mysql

from images.

Related Issues (20)

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.