Hi,
I am trying to configure an Cloudflare Tunnel for a simple httpbin app using docker.
Currently, docker run <my_image> fails to start cloudflared
[ec2-user@ip-172-31-86-153 httpbin]$ sudo docker run argo_httpbin
/usr/lib/python2.7/dist-packages/supervisor/options.py:298: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a “-c” argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching ’
2019-09-08 08:52:45,247 CRIT Supervisor running as root (no user in config file)
2019-09-08 08:52:45,251 INFO supervisord started with pid 1
2019-09-08 08:52:46,254 INFO spawned: ‘httpbin’ with pid 8
2019-09-08 08:52:46,264 INFO spawned: ‘cloudflared’ with pid 9
2019-09-08 08:52:46,718 INFO exited: cloudflared (exit status 1; not expected)
2019-09-08 08:52:47,872 INFO success: httpbin entered RUNNING state, process has stayed up for
than 1 seconds (startsecs)
Here is my dockerfile:
FROM ubuntu:18.04
RUN apt-get -yqq update
COPY . /opt/flaskapp
WORKDIR /opt/flaskapp
Supervisord
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
RUN mkdir -p /etc/supervisor/conf.d/
COPY supervisord.conf /etc/supervisord.conf
Cloudflared
RUN apt-get install -y wget
RUN wget -O- https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.tgz | tar xz
RUN mkdir -p /etc/cloudflared/
COPY cert.pem /etc/cloudflared/
COPY config.yml /etc/cloudflared/
HTTPBin
RUN apt install python3-pip git -y && pip3 install --no-cache-dir pipenv
ADD Pipfile Pipfile.lock /httpbin/
WORKDIR /httpbin
RUN /bin/bash -c “pip3 install --no-cache-dir -r <(pipenv lock -r)”
ADD . /httpbin
RUN pip3 install --no-cache-dir /httpbin
RUN pip3 install gunicorn
CMD [“/usr/bin/supervisord”]
My config.yml:
hostname: tunnel.koshaparekh.tk
url: https://localhost:8000
logfile: /var/log/cloudflared.log
My supervisord.conf
[supervisord]
nodaemon = true
[program: cloudflared]
command=/opt/flaskapp/cloudflared
autostart=true
autorestart=true
startretries=3
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
[program:httpbin]
command=gunicorn -b 0.0.0.0:80 httpbin:app -k gevent
autostart=true
autorestart=true
startretries=3
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
What am I doing incorrectly?