Skip to content
This repository was archived by the owner on Dec 29, 2017. It is now read-only.

Commit be9f5c1

Browse files
author
Quentin Dawans
authored
dockerfile (#31)
1 parent a546448 commit be9f5c1

File tree

5 files changed

+45
-6
lines changed

5 files changed

+45
-6
lines changed

.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.*
2+
__pycache__/
3+
build/
4+
dist/
5+
icon/
6+
*.egg-info/

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
language: python
22

3+
services:
4+
- docker
5+
36
python:
47
- '3.5'
58
- '3.6'
@@ -21,6 +24,7 @@ script:
2124
- python setup.py doc
2225
- python setup.py sdist
2326
- python setup.py bdist_wheel
27+
- docker build . -t pyslackers/sir-bot-a-lot
2428

2529
deploy:
2630
- provider: script

Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
FROM python:3.6-alpine
22

3-
ENV PYTHONPATH=./.pip:/app/.pip:.: \
4-
DOCKER=True
5-
COPY . /app/
6-
RUN python3 -m pip install -r /app/requirements/requirements.txt -t /app/.pip
7-
3+
RUN apk add --update --no-cache gcc g++ && pip install dumb-init
84

95
WORKDIR /app
106

11-
CMD ["python", "./run.py"]
7+
COPY . .
8+
RUN python3 -m pip install .
9+
10+
COPY docker.yml /etc/sirbot.yml
11+
12+
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
13+
CMD ["/bin/sh", "-c", "sirbot -c /etc/sirbot.yml --update && exec sirbot -c /etc/sirbot.yml"]

docker.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
sirbot:
2+
port: 8080
3+
plugins: []
4+
5+
logging:
6+
version: 1
7+
disable_existing_loggers: false
8+
formatters:
9+
simple:
10+
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
11+
handlers:
12+
console:
13+
class: logging.StreamHandler
14+
level: DEBUG
15+
formatter: simple
16+
stream: ext://sys.stdout
17+
loggers:
18+
sirbot:
19+
level: DEBUG
20+
handlers: [console]
21+
propagate: no
22+
root:
23+
level: INFO
24+
handlers: [console]
25+
propagate: no

sirbot/core/core.py

+2
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,15 @@ async def update(self):
227227
Trigger the update method of the plugins. This is needed if the plugins
228228
need to perform update migration (i.e database)
229229
"""
230+
logger.info('Updating Sir Bot-a-lot')
230231
for name, plugin in self._plugins.items():
231232
plugin_update = getattr(plugin['plugin'], 'update', None)
232233
if callable(plugin_update):
233234
logger.info('Updating %s', name)
234235
await plugin_update(self.config.get(name, {}), self._plugins)
235236
logger.info('%s updated', name)
236237
self._session.close()
238+
logger.info('Sir Bot-a-lot updated')
237239

238240
@property
239241
def app(self) -> web.Application:

0 commit comments

Comments
 (0)