docker: add Dockerfile with instructions

This commit is contained in:
dece 2020-11-06 11:43:29 +01:00
parent 5469b1cdf3
commit fe46b8d4ef
2 changed files with 41 additions and 6 deletions

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM python:3.7-slim
ARG UID
ARG GID
ENV DEBIAN_FRONTEND noninteractive
ADD edmond /app/edmond
WORKDIR /app
RUN pip install requests irc
RUN pip install -r edmond/plugins/requirements.txt
RUN groupadd --gid ${GID} edmond
RUN useradd --uid ${UID} --gid edmond \
--shell /usr/sbin/nologin --create-home --no-log-init \
edmond
ENV DEBIAN_FRONTEND teletype
USER edmond
ENTRYPOINT ["python", "-m", "edmond"]

View file

@ -8,14 +8,27 @@ New version of the infamous IRC bot.
Installation
------------
Clone the repository and install main dependencies using Pipenv:
Clone the repository.
The preferred installation way is using Docker:
```bash
# Build image with dependencies.
docker build -t edmond --build-arg UID=1000 --build-arg GID=1000 .
# Run container with config/resources/storage mount.
docker run -d \
-it \
-v $(pwd)/config.json:/app/config.json \
-v $(pwd)/resources:/app/resources \
-v $(pwd)/storage.json:/app/storage.json \
edmond \
-c config.json
```
Else you can install dependencies and run it in a virtual env:
```bash
pipenv install
```
Plugins dependencies can be manually installed with
```bash
pipenv run pip install -r edmond/plugins/requirements.txt
pipenv run python -m edmond
```