[+] Docker support

This commit is contained in:
SantaSpeen committed 2024-01-13 14:52:59 +03:00
1 parent a2bed9be1f
commit fb7869a64c
2 files changed
+13 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
FROM python:3.12.1-alpine
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY ./src .
CMD [ "python", "./main.py" ]
+3 -2
View File
@@ -6,7 +6,6 @@ import sys
import zipfile import zipfile
from collections import namedtuple from collections import namedtuple
from datetime import datetime from datetime import datetime
from pathlib import Path
import requests import requests
from loguru import logger from loguru import logger
@@ -15,6 +14,7 @@ from ruamel.yaml import YAML
yaml = YAML() yaml = YAML()
yaml.default_flow_style = False yaml.default_flow_style = False
IN_DOCKER = "DOCKER_CONTAINER" in os.environ
__version__ = '1.3.1' __version__ = '1.3.1'
@@ -113,7 +113,8 @@ def get_server_status():
def enter_to_exit(exit_code=1): def enter_to_exit(exit_code=1):
logger.info("Выход..") logger.info("Выход..")
input("\nНажмите Enter для продолжения..") if not IN_DOCKER:
input("\nНажмите Enter для продолжения..")
sys.exit(exit_code) sys.exit(exit_code)