{"id":23442546,"url":"https://github.com/mvdoc/psiturk-docker","last_synced_at":"2025-08-26T05:31:06.477Z","repository":{"id":75577338,"uuid":"66568710","full_name":"mvdoc/psiturk-docker","owner":"mvdoc","description":"A docker-compose configuration file to run psiturk with MySQL support and a NGINX reverse proxy.","archived":false,"fork":false,"pushed_at":"2017-12-29T09:08:43.000Z","size":236,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-20T21:57:00.975Z","etag":null,"topics":["docker-compose","jspsych","mechanical-turk","mysql","nginx","psiturk","psychology-experiments"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvdoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-25T15:10:22.000Z","updated_at":"2023-10-20T21:57:01.317Z","dependencies_parsed_at":"2023-06-06T23:30:15.716Z","dependency_job_id":null,"html_url":"https://github.com/mvdoc/psiturk-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fpsiturk-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fpsiturk-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fpsiturk-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fpsiturk-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvdoc","download_url":"https://codeload.github.com/mvdoc/psiturk-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230996113,"owners_count":18312574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","jspsych","mechanical-turk","mysql","nginx","psiturk","psychology-experiments"],"created_at":"2024-12-23T17:32:37.030Z","updated_at":"2024-12-23T17:32:37.852Z","avatar_url":"https://github.com/mvdoc.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psiturk-docker: a docker-compose configuration file to run psiturk with MySQL support.\n\nThe docker-compose file runs a standard nginx container, a standard\nMySQL container, and an ad-hoc psiturk container. It links them all up,\nso that the nginx container serves all the files it can to the\nparticipant of the experiment (delegating what it cannot serve to the\nGunicorn server run by psiturk inside the psiturk container) and so that\npsiturk can record data to the MySQL server container.\n\nDISCLAIMER: this is very experimental, it can be improved (see known\nissues below), but for the moment it works for me (at least testing it).\nFeel free to play with it (and maybe submit PRs so we all benefit from\nit? ;) )\n\n## HOW TO\n\nFirst, make sure that you change `config.txt` as necessary. Importantly,\nyou'll need to set `adserver_revproxy_host` to either the static IP\naddress of the machine that your experiment is deployed on or a fully\nqualified domain name (without the protocol) that resolves to that IP\naddress. You'll also need to set `adserver_revproxy_port` to 80. While\npsiturk normally runs on port 22362, nginx is a reverse proxy that sits\nin front of psiturk since it does a better job of handling traffic and\nserving static files, and nginx runs on port 80. It delegates everything\nelse to psiturk, running on port 22362.\n\n**Important**: If you're only just testing things on a local computer\n(*i.e.*, a computer that is not the deployment computer with a static IP\naddress), you should leave the `adserver_revproxy_host` value set to the\nloopback IP address of `127.0.0.1`, which is just another way of\npointing to the computer that you're currently using. This will allow\nyou to succesfully test and debug the experiment without having to\ndeploy it on the computer with the static IP address. However, when you\ndo deploy the experiment, *make sure* that you change\n`adserver_revproxy_host` to either the static IP address of the\ndeployment machine or a fully qualified domain name (without the\nprotocol) that resolves to that IP address.\n\nNext, install docker and docker-compose. Then run\n\n```\ndocker-compose up -d\n```\n\nThis should download the relevant images, build the psiturk image, run\nthe containers, and link them. By default they are launched in \"daemon\"\nmode (`-d`).\n\nThen, you need to log in into the psiturk container to use the psiturk\nshell:\n\n```\ndocker attach psiturkdocker_psiturk_1\n```\n\nor change `psiturkdocker_psiturk_1` with whatever name shows up for the\npsiturk container.  After that command, you should be logged into the\ncontainer. To test that everything works, try\n\n```\ncd psiturk-example psiturk\n```\n\nthis should launch the psiturk shell. Then cross your fingers and run\n\n```\nserver on\ndebug -p\n```\n\nif your server is visible in the network, copying and pasting the URL on\nthe browser should let you try the experiment.\n\nNote: to detach from the container **do not type `exit`**; this will\nkill the container (although it might restart automatically, it's not\nnice). Instead, press the sequence `ctrl+p ctrl+q` to detach.\n\n## Data and experiments\n\nBy default `docker-compose.yml` maps `./exp` in the host to `/psiturk`\nin the psiturk container.  (This folder is also mapped to\n`/var/www/psiturk-example` in the nginx container, but it is mapped as\nread only inside of that container; this is so nginx can serve the\nstatic files from the experiment, delegating the rest to the psiturk\ncontainer.) This means that you can put any experiment directory into\n`./exp`, then cd into `/psiturk` from within the psiturk container, and\nrun the psiturk shell.\n\nThe global psiturk configuration file is in `./exp/.psiturkconfig`, and\nthe env variable is set to point there inside the container.\n\nAlso, the mysql database is saved under `./data/db`, and the user and\npassword can be changed by changing the environment variables in\n`docker-compose.yml` (remember to change the `database_url` in the\n`config.txt` of the example if you do change it).\n\n## Accessing the database through adminer\n\nThe `docker-compose.yml` installs `adminer` as a service, which allows\nyou to check the database\nthrough webpage. You should be able to open the browser and visit\n`localhost:8080` to see the page. Insert the username and password, and\nyou can check when new subjects's data is recorded.\n\n## Known issues\n\n- if you run `server log` from the psiturk shell, it crashes miserably because psiturk wants\nxterm installed, but we're not installing it. If you do want to see the log, you can always\nlog in the container and `cat` or `tail` the `server.log` file.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdoc%2Fpsiturk-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvdoc%2Fpsiturk-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdoc%2Fpsiturk-docker/lists"}