LimeSurvey - the most popular
Free Open Source Software survey tool on the web.
This docker image easies limesurvey installation. It includes a MySQL database as well a web server.
To run limesurvey in 80 port just:
docker pull crramirez/limesurvey:latest docker run -d --name limesurvey -p 80:80 crramirez/limesurvey:latest
- Go to a browser and type http://localhost
- Click Next until you reach the Database configuration screen
- Then enter the following in the field:
- Database type MySQL
- Database location localhost
- Database user root*
- Database password
- Database name limesurvey #Or whatever you like
- Table prefix lime_ #Or whatever you like
You are ready to go.
Database in volumes
If you want to preserve data in the event of a container deletion, or version upgrade, you can assign the MySQL data into a volume which maps to a directory in your host:
docker run -d --name limesurvey -v ~/limesurvey/mysql:/var/lib/mysql -p 80:80 crramirez/limesurvey:latest
If you delete the container simply run again the above command. The installation page will appear again. Don't worry just put the same parameters as before and limesurvey will recognize the database.
If you want to preserve the uploaded files in the event of a container deletion, or version upgrade, you can assign the upload folder into a volume which maps to a directory in your host:
docker run -d --name limesurvey -v ~/limesurvey/upload:/app/upload -v ~/limesurvey/mysql:/var/lib/mysql -p 80:80 crramirez/limesurvey:latest
If you delete the container simply run again the above command. The installation page will appear again. Don't worry just put the same parameters as before and limesurvey will recognize the database and the uploaded files including images.
Using Docker Compose
You can use docker compose to automate the above command if you create a file called docker-compose.yml and put in there the following:
limesurvey: ports: - "80:80" volumes: - ~/limesurvey/mysql:/var/lib/mysql - ~/limesurvey/upload:/app/upload image: crramirez/limesurvey:latest
docker-compose up -d
I can help giving you the command line sentences to run:
Be sure you have already an empty container with initialized database. I mean you ran the setup steps.
First figure out your container id:
Your first value. In this example: d4cc1a0a79f0
Then copy your backup to the container:
docker cp LimeSurvey_lime_dump_2016-03-11.sql d4cc1a0a79f0:/root
Then restore your backup:
docker exec d4cc1a0a79f0 bash -c "mysql -D lime </root/LimeSurvey_lime_dump_2016-03-11.sql"
Remember using your database name in -D option.
Refresh your browser. It should be working now.
Hope it helps
Hi crramirez, thanks for making this container! Do you have an interface to import the backup from LS's "Backup entire database" option? It is supposed to be restored via phpmyadmin, but you do seem to have installed it in the container. Please advise, thanks!
New version 2.50.1 maps to livesurvey 2.50. This version adds persistence to the upload folder via a volume.
Version upgraded to 2.50 a new look with bootstrap take a look.
If you are upgrating remember to backup your upload folder and your surveys
Sorry when I updated the README.md a new automatic docker build was triggered and the limesurvey download url wasn't available anymore.
I updated the Dockerfile and also tagged the version with 2.06 so in a similar event you can always pull the tagged version.
Thank you for your quick answer.
I tested the following command on the version of your image I had on my machine and it works :
docker run -d -v ~/limesurvey/mysql:/var/lib/mysql -p 80:80 crramirez/limesurvey:latest
However, then, i updated your image and your latest image does not seem to work anymore : the http://locahost displays the apache page and not the limesurvey one...
Did you modify the configuration of the latest image compared to the previous one ?
In fact you can use volumes for that. I've updated the description talking about this case. Test and tell me. Later I will submit how to preserve images and uploads in general
First thank you for this image !
Then, concerning the persistence of the data in the container, isn't there a way to launch the container with volumes (docker run -v <some_host_dir>:<data_in_container_dir> ...) to persist limesurvey datas (surveys, configuration, users...) ? By the way, are all datas stored in the database ? (if so, the only volume to mount is the one containing the DB files no ?
You said in a previous answer that surveys could be exported and imported again but what if the container stops brutally (because of an server down for example), the export was not done, and yet we want to be able to retrieve all the previous data at the next launch, right ?
Isn't volumes could solve this situation ?
Updated to limesurvey 2.06
I think I saw your comment too late. This error denotes that the database is down. You should test restarting the container.
If you made a backup you can try from scratch and import the surveys.
This is what I could try