This commit is contained in:
5
.env.sample
Normal file
5
.env.sample
Normal 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
21
Dockerfile
Normal 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"]
|
@ -7,6 +7,24 @@ services:
|
||||
ports:
|
||||
- 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:
|
||||
image: 'postgres:12'
|
||||
restart: always
|
||||
@ -17,12 +35,12 @@ services:
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
# volumes:
|
||||
# - ${PG_MNT}:/var/lib/postgresql/data
|
||||
ports:
|
||||
- ${PG_OUTBOUND_PORT}:5432
|
||||
# ports:
|
||||
# - ${PG_OUTBOUND_PORT}:5432
|
||||
redis:
|
||||
image: "redis:alpine"
|
||||
command: redis-server --appendonly yes --appendfsync everysec
|
||||
ports:
|
||||
- 6379:6379
|
||||
# ports:
|
||||
# - 6379:6379
|
||||
# volumes:
|
||||
# - ${FDS_REDIS_MNT}:/data
|
||||
|
9
requirements.txt
Normal file
9
requirements.txt
Normal 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
|
@ -2,7 +2,7 @@ import base64
|
||||
import logging
|
||||
import os
|
||||
|
||||
from sphinx.util import requests
|
||||
import requests
|
||||
|
||||
from config import Config
|
||||
|
||||
|
Reference in New Issue
Block a user