Docker image #42

Merged
Miroslavsckaya merged 13 commits from feature_docker into master 2022-08-13 16:41:20 +00:00
4 changed files with 35 additions and 7 deletions
Showing only changes of commit dcc7dda040 - Show all commits

View file

@ -10,4 +10,7 @@ __pycache__
pylama.ini
# Bot documentation
README.md
README.md
# Environment
.env

5
.gitignore vendored
View file

@ -6,4 +6,7 @@
/__pycache__
# Database
skobkin marked this conversation as resolved
Review

Missing EOL (\n) on the last line

Missing EOL (`\n`) on the last line
/*.db
/*.db
# Environment
.env

View file

@ -8,11 +8,6 @@ RUN pip install -r requirements.txt
ENV PYTHONUNBUFFERED=1
# App settings
ENV RSSBOT_DSN=xxx
ENV RSSBOT_TG_TOKEN=xxx
ENV LOG_LEVEL=INFO
ENTRYPOINT [ "python" ]
CMD [ "bot.py" ]

27
docker-compose.yml Normal file
View file

@ -0,0 +1,27 @@
version: '3.7'
skobkin marked this conversation as resolved
Review

I just understood that README.md has no documentation about running the bot in Docker yet.

I think it's a good idea to fix that.

I just understood that `README.md` has no documentation about running the bot in Docker yet. I think it's a good idea to fix that.
services:
rss-bot:
build: .
image: rss_bot
# App settings
# DSN schema: postgres://username:password@hostname/database_name
environment:
- RSSBOT_DSN=xxx
- RSSBOT_TG_TOKEN=xxx
- LOG_LEVEL=INFO
container_name: rss_bot
depends_on:
- postgres
postgres:
image: postgres:14-alpine
# Postgres settings.
# Can use POSTGRES_DB variable. https://hub.docker.com/_/postgres
environment:
- POSTGRES_PASSWORD=xxx
volumes:
- postgres_bot_db:/var/lib/postgresql/data
volumes:
postgres_bot_db: