diff --git a/.dockerignore b/.dockerignore index a75f613..50589fe 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,4 +10,7 @@ __pycache__ pylama.ini # Bot documentation -README.md \ No newline at end of file +README.md + +# Environment +.env \ No newline at end of file diff --git a/.gitignore b/.gitignore index 040e37d..7b73952 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ /__pycache__ # Database -/*.db \ No newline at end of file +/*.db + +# Environment +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0c8c4b4..d9c2d9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8a5bed1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3.7' + +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: