Sign inSign up

niiiklaus/twisted

By niiiklaus

•Updated over 5 years ago

Multi-arch minimal HTTP server, with SSL support.

Image
0

430

niiiklaus/twisted repository overview

⁠Docker-twisted

⁠Features

  • Minimal, built with latest official Alpine base image.
  • Multi-arch, built upon all the architectures that the base image offers.
  • SSL support, easy to work with self-signed certificates.

⁠Installation

$ docker pull niiiklaus/twisted:latest

⁠Usage

⁠Parameters

We always recommend you to use Docker containers in normal user for safety reason.

If you use HTTPS, the start script will look for /certs/app.key and /certs/app.crt by default. You can change the target file names using environment variables, but don't forget to map the volume where your certificate files stored to the container.

ParameterFunction
-u $(id -u):$(id -g)User mapping (always recommended).
-p 6080:6080HTTP port.
-p 6443:6443HTTPS port (listened if you map certificate files correctly).
-v /path/to/app:/appThe directory where the web service starts.
-v /path/to/certs:/certsThe directory where certificate files stored.
-e KEY_FILE=custom.keyThe start script will look for /certs/custom.key instead of /certs/app.key.
-e CRT_FILE=custom.crtThe start script will look for /certs/custom.crt instead of /certs/app.crt.
⁠Examples
⁠One-time basic HTTP service
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -p 6080:6080 \
  niiiklaus/twisted:latest
⁠Constant HTTP service with HTTPS

Sometimes SSL raises an error due to time reasons, so read-only mapping /etc/localtime and /etc/timezone may be necessary.

docker run -itd \
  -u $(id -u):$(id -g) \
  -p 6080:6080 \
  -p 6443:6443 \
  -v /etc/localtime:/etc/localtime:ro \
  -v /etc/timezone:/etc/timezone:ro \
  -v /path/to/app:/app \
  -v /path/to/certs:/certs:ro \
  -e KEY_FILE="KEY_FILE_NAME.key" \
  -e CRT_FILE="CRT_FILE_NAME.crt" \
  niiiklaus/twisted:latest

Tag summary

Content type

Image

Digest

Size

27.2 MB

Last updated

over 5 years ago

docker pull niiiklaus/twisted