Giter Club home page Giter Club logo

errbot-docker's Introduction

kriev/errbot-alpine


CI: Build Status Python3: Python2


Docker image for Err, a chat-bot designed to be easily deployable, extensible and maintainable.

This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

Available tags

  • python3: A Alpine Linux image with Python 3 and the latest stable release of Err from PyPI.
  • python2: A Alpine Linux image with Python 2 and the lastest working release of Err (4.2.2) for Python2 PyPI.
  • latest: Same image as Python3 tag.

Usage

This container can be started in three different modes:

  • shell: Start a bash session as the bot account (err).
  • rootshell: Start a bash session as the root account.
  • err: Start the bot itself. Any additional arguments passed here will be passed on to err.py.

For example, try: docker run --rm -it kriev/errbot-alpine err --help

To successfully run the bot, you will have to mount a config.py into the /err/ directory (--volume option to docker run).

Inside the container, /err/data/ has already been set aside for data storage. You should mount this directory as a data volume as well in order to de-couple your bot data from the container itself.

docker run -it -v /path/to/errbot/config.py:/err/config.py -v /path/to/errbot/data:/err/data kriev/errbot-alpine err

Installing dependencies

Some plugins require additional dependencies that may not be installed in the virtualenv by default. There are three ways to deal with this, listed from best practice to worst:

  1. Build your own image.
  2. Let Err install dependencies automatically by setting AUTOINSTALL_DEPS = True in config.py.
  3. Enter a running container manually (docker exec --interactive --tty <container-name> shell or rootshell (if root is needed for OS related dependencies) where <container-name> is the name listed by docker ps) and install with pip (gosu err /err/virtualenv/bin/pip install somepkg).

Container layout

  • /err: Home directory of the user account for Err. config.py is expected to go here.
  • /err/.ssh/: The .ssh directory of the bot user (you can mount private SSH keys into this directory if you need to install plugins from private repositories).
  • /err/virtualenv/: The virtualenv containing the Python interpreter and installed packages.
  • /err/data/: A volume intended to store bot data (BOT_DATA_DIR setting of config.py).

Security notes

  • The bot is run under its own user account (err), not as root.
  • SSH is set up to automatically add unknown host keys (StrictHostKeyChecking no).

TO-DO:

  • Review the storage volume settings

Credits

This is a modified version of https://github.com/zoni/docker-err to run on Alpine. Credits for the bash scripts and base idea goes to him.

errbot-docker's People

Contributors

hgranillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.