Comments (5)
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.
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.
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.
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.
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)
- Dependency Dashboard
- docker container doesn't start after resetting the container HOT 7
- Images on dockerhub and github registry not the same HOT 2
- Setting environment variables to falsy values (0, empty string, etc) reverts to default value HOT 1
- config.php belongs to user root by default: Could not auto-encrypt passwords. Error was: "cannot write file". HOT 2
- Docker data not persisted HOT 6
- "&" in the password bricks the config file (docker) HOT 8
- Old logo on Docker Hub HOT 1
- Error setting `USER` in `Dockerfile` HOT 4
- docker update HOT 1
- Latest Github Expiry plugin not working with latest version of YOURLS HOT 1
- Automatic inclusion of plugin-specific configuration HOT 1
- Volume in docker-compose.yml HOT 2
- Latest `fpm-alpine` image is broken HOT 2
- `fpm` image does not serve static files HOT 1
- forbidden HOT 2
- It seems something wrong with your demo yml configs ? HOT 2
- Docker setup doesn't work at all HOT 3
- Mysqli with SSL is broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from images.