martialblog/docker-limesurvey

Question: provide a simple sample please

cavo789 opened this issue · 7 comments

Hello

Thanks for your great work on docker-limesurvey.

Can you please provide a simple and working example or guide me on how to use your image?

I've created a new folder on my Windows WSL2 partition. In that empty folder, I've created a docker-compose.yml file, taking your file https://github.com/martialblog/docker-limesurvey/blob/master/docker-compose.example.yml

Then I run docker-compose up and Docker is download images and process the .yml file.

In your https://github.com/martialblog/docker-limesurvey#running-this-image-with-docker-compose paragraph, you're saying that we can then access to the http://localhost:8080/ URL but it isn't working neither http://127.0.0.1:8080/.

My browser is returning an error ERR_EMPTY_RESPONSE. Same result for curl http://127.0.0.1:8080.

Is it possible to guide me? How can I run a simple LimeSurvey web application using your Docker image?

Many thanks!

Remark: My current need is to migrate from 3.22.6 to probably 5. Is it possible to refers to a 3.22.6 docker image? Thanks!

Hey there, thanks for the feedback.

I'm not too familiar with Windons and Docker on Windows, maybe the port-mapping works different on that system.

The docker-compose.yml file is really as simple as possible I think. Can you provide some logs maybe, so we can have a look at what the webserver says.

You can change the Dockerfile the docker-compose file uses by changing the line: context: 5.0/apache/

Thanks Martial.

Concerning Windows: I'm using Docker since a few months, there are no difference with Linux I mean processing the docker-compose.yml file will give the same result. For information too: I'm running the .yml file in a WSL2 (Windows Subsystem Linux) partition; it's not a true Linux but really, really near.

I'll try once more this morning and post here logs.

Thanks

Here are what I just made once more on my computer:

  1. I run docker system prune -a to make sure Docker images/containers/volumes/network are empty (just needed to make sure everyting is starting from scratch)
  2. Create an empty docker_ls foder
  3. Create a docker-compose.yml file it, copy of your https://github.com/martialblog/docker-limesurvey/blob/master/docker-compose.example.yml file
  4. On the prompt, I run docker-compose up -d to let Docker to download images and create things
Creating volume "docker_ls_limesurvey" with default driver
Creating volume "docker_ls_db-data" with default driver
Pulling db (postgres:10-alpine)...
10-alpine: Pulling from library/postgres
5843afab3874: Pull complete
525703b16f79: Pull complete
86f8340bd3d9: Pull complete
79044baaabb2: Pull complete
36cf25109e96: Pull complete
bc752cda1992: Pull complete
17905079c3e2: Pull complete
04d52afe0744: Pull complete
325e49088bb1: Pull complete
Digest: sha256:0eef1c94e0c4b0c4b84437785d0c5926f62b7f537627d97cf9ebcd7b205bc9aa
Status: Downloaded newer image for postgres:10-alpine
Pulling limesurvey (martialblog/limesurvey:latest)...
latest: Pulling from martialblog/limesurvey
69692152171a: Pull complete
2040822db325: Pull complete
9b4ca5ae9dfa: Pull complete
ac1fe7c6d966: Pull complete
5b26fc9ce030: Pull complete
3492f4769444: Pull complete
1dec05775a74: Pull complete
77107a42338e: Pull complete
f58e4093c52a: Pull complete
d32715f578d3: Pull complete
7a73fb2558ce: Pull complete
667b573fcff7: Pull complete
75e2da936ffe: Pull complete
9d39b5e83a19: Pull complete
41f68b9389d0: Pull complete
8e5cd841e041: Pull complete
d0bfa2ebfe39: Pull complete
06f85aa22444: Pull complete
a3f346f64ec7: Pull complete
4924902d2fd2: Pull complete
Digest: sha256:dfe4b74b02d8890120abf91ba3b657cdab6f9fe1403e78faa74eaeaf6c30062f
Status: Downloaded newer image for martialblog/limesurvey:latest
Creating docker_ls_db_1 ... done
Creating docker_ls_limesurvey_1 ... done
  1. I run docker-compose ps and check that everything is Up and take a look to the port: 8080
         Name                       Command               State                        Ports
------------------------------------------------------------------------------------------------------------------
docker_ls_db_1           docker-entrypoint.sh postgres    Up      5432/tcp
docker_ls_limesurvey_1   /var/www/html/entrypoint.s ...   Up      80/tcp, 0.0.0.0:8080->8080/tcp,:::8080->8080/tcp
  1. Check the service, run docker-compose exec limesurvey ls -al and I get well the list of files of a LimeSurvey installation. There is a file called composer.json in the root folder so I try to access that file

  2. Try to access to http://127.0.0.1:8080/composer.json or http://localhost:8080/composer.json (I get the same if I don't mention any file, just http://127.0.0.1:8080). Always empty response (of course, same result if I try with a browser like Chrome)

❯ curl http://127.0.0.1:8080/composer.json
curl: (52) Empty reply from server
❯ curl http://localhost:8080/composer.json
curl: (52) Empty reply from server
  1. By running docker-compose logs limesurvey I get this:
Attaching to docker_ls_limesurvey_1
limesurvey_1  | DNS fwd/rev mismatch: db != docker_ls_db_1.docker_ls_default
limesurvey_1  | db [192.168.48.2] 5432 (?) : Connection refused
limesurvey_1  | Info: Waiting for database connection...
limesurvey_1  | DNS fwd/rev mismatch: db != docker_ls_db_1.docker_ls_default
limesurvey_1  | db [192.168.48.2] 5432 (?) open
limesurvey_1  | Info: Generating config.php
limesurvey_1  | Info: Using PostgreSQL configuration
limesurvey_1  | Info: Using TCP connection
limesurvey_1  | Info: Creating security.php
limesurvey_1  | Info: Check if database already provisioned. Nevermind the Stack trace.
limesurvey_1  | Warning: No encryption keys were provided
limesurvey_1  | Warning: A security.php config will be created by the application
limesurvey_1  | Warning: THIS FILE NEEDS TO BE PERSISTENT
limesurvey_1  | CException: DataBase version are not found, seems LimeSurvey are not installed. in /var/www/html/application/commands/UpdateDbCommand.php:36
limesurvey_1  | Stack trace:
limesurvey_1  | #0 /var/www/html/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
limesurvey_1  | #1 /var/www/html/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
limesurvey_1  | #2 /var/www/html/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
limesurvey_1  | #3 /var/www/html/application/commands/console.php(69): CApplication->run()
limesurvey_1  | #4 {main}
limesurvey_1  | Running console.php install
limesurvey_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.48.3. Set the 'ServerName' directive globally to suppress this message
limesurvey_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.48.3. Set the 'ServerName' directive globally to suppress this message
limesurvey_1  | [Tue Jul 06 05:53:40.975841 2021] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.20 configured -- resuming normal operations
limesurvey_1  | [Tue Jul 06 05:53:40.976047 2021] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Hope you can see what I'm doing incorrectly...

My goal is to be able to use your image martialblog/limesurvey:3.22.6_200219 to be able to create a DEV environment on my dev machine, getting back a LS database from a production site, do stuff and then start a migration to the latest version of LS. We've a few LS instances, I suspect versions are always different.

Many, many thanks for any help.

You can change the Dockerfile the docker-compose file uses by changing the line: context: 5.0/apache/

Yes I've see it and yesterday night, I've tried this on my computer and I got the LS interface (=> it's work) but... is it the good way to do? I mean, by using the docker-compose.yml file (and not the .example one), I'll recreate the image. The https://github.com/martialblog/docker-limesurvey/blob/master/3.0/apache/Dockerfile use a php:7.4-apache base image while I was expecting to see/put martialblog/limesurvey:3.22.6_200219. That docker-compose.yml file is the one you are using to build your images; the idea isn't (I think) to use that file and re-create the image when you already did and publish it on docker hub with the good tag.

I miss something / I'm doing something wrong somewhere I think.

Hey,

what I would do is, copy the docker-compose-example.yml to something like docker-compose-update-test.yml and adjust the LS version to 3.22.6_200219. This will pull the 3.22 Image from the DockerHub and you can start the app and import the databse.

If the 3.22 Image is not available anymore, you can clone the repo and checkout the git tag for this version and build the Docker Image.

From there you can start testing the update, it's best to consul the LS documentation to see what they recommend. You can then switch out the LS container with a newer version while keeping the DB container. I don't know if you can update from LS 3 directly to 5, but the documentation should tell you that.

Hello Martial

My apologies for the delay.

I was busy on "How to make it working" since last Thursday and then, I had to "catch up" without asking myself too many questions.

For that reason, I've reuse your docker-compose.yml file (and not the .example one) and your 3.0/apache/Dockerfile file too then I've add here and there my own rules since I need a customized LS instance (for instance with three plugins pre-installed and my own DB).

I've thus stop to search for how can I reuse your existing images (i.e. martialblog/limesurvey:3.22.6_200219) and rebuild it.

Many thanks for your time, answers and your investment to maintain this repo.