Docker (Ubuntu20.04) pour CGI avec Python (2.7 / 3.6 / 3.7 / 3.8 / 3.9 / 3.10)
Il s'agit d'un simple paramètres de serveur Web Python.
Avec cette image Docker, vous pouvez créer une application Web simple avec CGI.
Comment utiliser
# build image
docker build -t pycgi .
# run image
HASH= ` docker run -p 8883:80 -d pycgi `
# exec container
docker exec -it $HASH /bin/bash
Vous pouvez accéder à partir de l'URL ci-dessous après l'exécution du conteneur Docker.
- Script Shell ... http: // localhost: 8883 / cgi-bin2 / sh.cgi
- Python2.7 ... http: // localhost: 8883 / cgi-bin2 / py27.cgi
- Python3.6 ... http: // localhost: 8883 / cgi-bin2 / py36.cgi
- Python3.7 ... http: // localhost: 8883 / cgi-bin2 / py37.cgi
- Python3.8 ... http: // localhost: 8883 / cgi-bin2 / py38.cgi
- Python3.9 ... http: // localhost: 8883 / cgi-bin2 / py39.cgi
- Python3.10 ... http: // localhost: 8883 / cgi-bin2 / py310.cgi
Autoriser la version Python
Références
- Utilisation de Docker avec Apache2
- 【Linux】 Ruby で書いた cgi を apache で動かしてみる (japonais)
Licence