MVP
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Andrey Gumirov
2022-05-01 01:56:47 +07:00
parent 56adc16b04
commit 80584dbaf9
6 changed files with 58 additions and 8 deletions

3
.env
View File

@ -1,3 +0,0 @@
PG_USER=pg
PG_PASS=pg
PG_OUTBOUND_PORT=5432

5
.env.sample Normal file
View File

@ -0,0 +1,5 @@
PG_USER=pg
PG_PASS=<password>
PG_OUTBOUND_PORT=5432
GROUP_ID=<group id>
TOKEN=<token>

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM python:3.9
ENV DB_ADDR localhost:5432
ENV GROUP_ID group_id
ENV NFT_ADDR http://localhost:5001
ENV PASS pg
ENV REDIS_ADDR localhost
ENV TMP_DIR ./tmp
ENV TOKEN token
WORKDIR /app
RUN mkdir -p /app/tmp
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY . /app
CMD ["python3", "main.py"]

View File

@ -7,6 +7,24 @@ services:
ports: ports:
- 5001:5000 - 5001:5000
bot:
build:
context: .
dockerfile: Dockerfile
environment:
- DB_ADDR=pgdb:5432
- GROUP_ID=${GROUP_ID}
- NFT_ADDR=http://image_gen:5001
- PASS=${PG_PASS}
- REDIS_ADDR=redis
- TMP_DIR=./tmp
- TOKEN=${TOKEN}
- USER=${PG_USER}
depends_on:
- pgdb
- redis
- image_gen
pgdb: pgdb:
image: 'postgres:12' image: 'postgres:12'
restart: always restart: always
@ -17,12 +35,12 @@ services:
- PGDATA=/var/lib/postgresql/data/pgdata - PGDATA=/var/lib/postgresql/data/pgdata
# volumes: # volumes:
# - ${PG_MNT}:/var/lib/postgresql/data # - ${PG_MNT}:/var/lib/postgresql/data
ports: # ports:
- ${PG_OUTBOUND_PORT}:5432 # - ${PG_OUTBOUND_PORT}:5432
redis: redis:
image: "redis:alpine" image: "redis:alpine"
command: redis-server --appendonly yes --appendfsync everysec command: redis-server --appendonly yes --appendfsync everysec
ports: # ports:
- 6379:6379 # - 6379:6379
# volumes: # volumes:
# - ${FDS_REDIS_MNT}:/data # - ${FDS_REDIS_MNT}:/data

9
requirements.txt Normal file
View File

@ -0,0 +1,9 @@
sqlalchemy~=1.4.36
redis~=3.5.3
vkwave~=0.2.16
matplotlib~=3.5.1
numpy~=1.21.2
pillow~=9.0.1
flask~=1.1.2
requests~=2.25.1
psycopg2

View File

@ -2,7 +2,7 @@ import base64
import logging import logging
import os import os
from sphinx.util import requests import requests
from config import Config from config import Config