add init code
This commit is contained in:
parent
925152c19c
commit
7d6a8c67f3
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
.venv/
|
||||
.idea/
|
||||
__pychache__/
|
||||
__pychache__/*
|
||||
|
11
docker-compose.yaml
Normal file
11
docker-compose.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
version: "3.5"
|
||||
|
||||
services:
|
||||
rps:
|
||||
build: ./rps
|
||||
stdin_open: true
|
||||
tty: true
|
||||
environment:
|
||||
DB_PASS: ${DB_PASS}
|
||||
volumes:
|
||||
- ./rps:/rps
|
0
rps/__init__.py
Normal file
0
rps/__init__.py
Normal file
21
rps/__main__.py
Normal file
21
rps/__main__.py
Normal file
@ -0,0 +1,21 @@
|
||||
import uvloop
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
|
||||
def main() -> None:
|
||||
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||
asyncio.run(async_main())
|
||||
logging.info("Created async loop")
|
||||
|
||||
|
||||
async def async_main() -> None:
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
format='[%(levelname)s][%(name)s] %(message)s'
|
||||
logging.basicConfig(level=logging.INFO, format=format)
|
||||
|
||||
logging.info("Started program")
|
||||
main()
|
23
rps/dockerfile
Normal file
23
rps/dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM python:3.8-slim-buster
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
RUN apt update && apt install -y \
|
||||
libavdevice-dev \
|
||||
libavfilter-dev \
|
||||
libopus-dev \
|
||||
libvpx-dev \
|
||||
pkg-config \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/* \
|
||||
|
||||
RUN pip install --upgrade \
|
||||
pip \
|
||||
poetry \
|
||||
|
||||
RUN poetry update \
|
||||
&& \
|
||||
poetry install \
|
||||
|
||||
CMD python -m backend
|
Loading…
Reference in New Issue
Block a user