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 named volume:
docker volume create --name mysql docker run -d --name limesurvey -v 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 named volume:
docker volume create --name upload docker run -d --name limesurvey -v upload:/app/upload -v 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
Sorry for the delay. Again I only see the comments when I visit the site. It doesn't send me any emails.
Docker has a new way to manage volumes called named volumes. Using this docker takes care of the volume but it never deletes it unless you explicitly say it. With the advantage that can be associated with a new container in the same way as host directories.
First create the volumes:
docker volume create --name mysql
docker volume create --name upload
Then the docker run:
docker run -d --name limesurvey -v upload:/app/upload -v mysql:/var/lib/mysql -p 80:80 crramirez/limesurvey:latest
You can always see your volumes here:
docker volume ls
I will update the documentation for this information.
I had problems with the config volume. I will update this when it works for me.
I am getting this error on both 14.04 and 16.04 using this image:
/upload directory Found & writable Found & Unwritable
Setup cannot proceed. If I take the /upload volume out of the command, all is well, but that limits my options going forward, doesn't it?
You may save your configuration to the Docker host by adding this to your
docker run command:
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