diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9a8c668 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.11-rc-alpine + +ENV cloud_name raincloud + +RUN apk update && apk add git +RUN python -m venv /opt/venv +RUN . /opt/venv/bin/activate && python -m pip install git+https://github.com/Deleh/raincloud +RUN . /opt/venv/bin/activate && python -m pip install gunicorn + +EXPOSE 8000/tcp + +ENTRYPOINT . /opt/venv/bin/activate && gunicorn --bind=0.0.0.0:8000 "raincloud:create_app(base_path='/var/www/raincloud',cloud_name='${cloud_name}')" \ No newline at end of file diff --git a/README.org b/README.org index c808f7f..84e56c4 100644 --- a/README.org +++ b/README.org @@ -87,6 +87,22 @@ | =cloudName= | Name of the raincloud | =str= | =raincloud= | =bobsCloud= | | =basePath= | Base path of the raincloud | =str= | | =/var/lib/raincloud= | +*** Docker + + A self-contained =Dockerfile=, based on [[https://www.alpinelinux.org/][Alpine Linux]], is available in the repository. + You can use it to build a /raincloud/ image locally with the following command: + + : $ docker build -t raincloud:latest -f Dockerfile + + A container of the image exposes raincloud at port =8000= and uses the base directory =/var/www/raincloud=. + Use dockers =-p= and =-v= flag to map the port on your host and to mount a base directory: + + : $ docker run -p :8000 -v :/var/www/raincloud raincloud:latest + + If you want to change the cloud name you can pass the =cloud_name= environment variable to the container: + + : $ docker run -p :8000 -v :/var/www/raincloud -e "cloud_name=podcloud" raincloud:latest + ** Configuration /raincloud/ provides two configuration options which can be passed to =raincloud.create_app()=: