I'm new to docker and am stuck on correctly exposing ports for psiturk.
I have a docker-compose.yml file that creates a psiturk container, a nginx container, an adminer container, and a mysql container. I am attempting to run the psiturk experiment in sandbox mode on mTurk. The server cannot connect. I've exposed the ports. When I run psiturk outside of Docker, I can run an experiment in sandbox so it's not my computer's firewall.
I've heard of publishing exposed ports and attempted this by adding:
ports:
- 22362:22362
to the psiturk container, but it didn't work.
For my docker-compose.yml file:
version: '3'
services:
psiturk:
container_name: my-experiment
build: .
volumes:
- ./exp:/exp
tty: true
stdin_open: true
restart: unless-stopped
nginx:
container_name: my-experiment-nginx
image: nginx:latest
ports:
- 80:80
volumes:
- ./exp:/var/www/exp:ro
- ./default.conf:/etc/nginx/conf.d/default.conf
restart: unless-stopped
db:
container_name: my-experiment-db
image: mysql:5.7
volumes:
- ./data/db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: anothersafepassword
MYSQL_DATABASE: shared4data
MYSQL_USER: jorja
MYSQL_PASSWORD: totallysafepassword
restart: unless-stopped
adminer:
container_name: my-experiment-adminer
image: adminer:latest
ports:
- 127.0.0.1:8080:8080
For my dockerfile:
FROM python:3.6-stretch
LABEL maintainer="Jorja Shires <[email protected]>" version="1.0"
ENV PSITURK_GLOBAL_CONFIG_LOCATION "/exp"
WORKDIR "/exp"
RUN pip install \
psiturk==2.3.8 \
pymysql==0.10.0 \
python-Levenshtein==0.12.0 \
&& rm -rf ~/.cache/pip
CMD ["bash"]
EXPOSE 22362
EXPOSE 80
For my psiturk config file:
[Server Parameters]
host = 0.0.0
port = 22362
cutoff_time = 30
logfile = server.log
loglevel = 2
debug = true
threads = auto
adserver_revproxy_host = MyStaticIPAddress
adserver_revproxy_port = 80
[Shell Parameters]
launch_in_sandbox_mode = true
#bonus_message = "Thanks for participating!"
use_psiturk_ad_server = true
ad_location = false