- L: Linux alpine
- G: Gunicorn
- P: Python 2.7
challenge_ddctf_2019_web_homebrew_event_loop_base
- FLAG=ctfhub{gunicorn_web}
- gunicorn This is used in Dockerfile(require)
- MODULE_NAME=app
- VARIABLE_NAME=app
- WORK_CLASS=gevent
You should rewrite flag.sh when you use this image.
The $FLAG
is not mandatory, but i hope you use it!
gunicorn
Eg:
# Flask
MODULE_NAME=app VARIABLE_NAME=app WORK_CLASS=gevent gunicorn --chdir="/app" -w 2 -k $WORK_CLASS -b 0.0.0.0:80 -u nobody -g nogroup --access-logfile - $(MODULE_NAME):$(VARIABLE_NAME)
# as
gunicorn --chdir="/app" -w 2 -k gevent -b 0.0.0.0:80 -u nobody -g nogroup --access-logfile - app:app
---
# Django
MODULE_NAME='test.wsgi' VARIABLE_NAME='application' WORK_CLASS=gevent gunicorn --chdir="/app" -w 2 -k $WORK_CLASS -b 0.0.0.0:80 -u nobody -g nogroup --access-logfile - $(MODULE_NAME):$(VARIABLE_NAME)
# as
gunicorn --chdir="/app" -w 2 -k gevent -b 0.0.0.0:80 -u nobody -g nogroup --access-logfile - test.wsgi:application
- src 网站源码
- app.py
- requirements.txt This is used in Dockerfile(require)
- ...etc
- Dockerfile
- docker-compose.yml
FROM ctfhub/base_web_gunicorn_python_27
ENV WORK_CLASS=gevent MODULE_NAME=app VARIABLE_NAME=app
COPY src /app
COPY _files/flag.sh /flag.sh