Skip to content

Commit 31a91bb

Browse files
committed
Updated reqs, remove obsolete code, improved docker
1 parent 9b3eba2 commit 31a91bb

15 files changed

+291
-474
lines changed

.dockerignore

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
# Other stuff
107+
.env.example
108+
.gitignore
109+
.github/
110+
app.json
111+
Procfile
112+
README.md
113+
Pipfile
114+
Pipfile.lock
115+
logviewer.sh
File renamed without changes.

Dockerfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
FROM library/python:latest
2-
RUN apt update && apt install -y pipenv
3-
RUN mkdir -p /bot && cd /bot && git clone https://github.com/kyb3r/logviewer .
4-
WORKDIR /bot
5-
RUN pipenv install
1+
FROM python:3.9-slim as py
2+
3+
FROM py as build
4+
5+
RUN apt update && apt install -y g++
6+
COPY requirements.txt /
7+
RUN pip install --prefix=/inst -U -r /requirements.txt
8+
9+
FROM py
10+
11+
ENV USING_DOCKER yes
12+
COPY --from=build /inst /usr/local
13+
14+
WORKDIR /logviewer
15+
CMD ["python", "app.py"]
16+
COPY . /logviewer
617

7-
CMD ["pipenv", "run", "python3", "app.py"]

Pipfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[[source]]
2+
name = "pypi"
23
url = "https://pypi.org/simple"
34
verify_ssl = true
4-
name = "pypi"
5+
6+
[dev-packages]
57

68
[packages]
7-
python-dateutil = "*"
8-
motor = "*"
9-
sanic = "~=19.3"
10-
dnspython = ">=1.16.0"
11-
natural = "*"
12-
sanic-session = "==0.5.1"
13-
"Jinja2" = "*"
14-
aiohttp = "*"
15-
discord-py = "*"
9+
jinja2 = "~=3.0.1"
10+
motor = "~=2.4.0"
11+
natural = "~=0.2.0"
12+
pymongo = {version = "*", extras = ['srv']} # Required by motor
13+
python-dateutil = "~=2.8.1"
14+
sanic = "~=21.6.0"
1615

17-
[dev-packages]
16+
[scripts]
17+
logviewer = "python app.py"
1818

1919
[requires]
20-
python_version = "3.7"
20+
python_version = "3.9"

0 commit comments

Comments
 (0)