Add initial support for Docker

This commit is contained in:
2022-12-08 12:38:05 +01:00
parent 905b4ad044
commit ee3c2c9b0d
6 changed files with 159 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
# ---> VisualStudioCode
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Python cache directories
__pycache__/
# Git
.git/
.gitignore
# Docker
Dockerfile
# Database
*.sqlite3
+17
View File
@@ -0,0 +1,17 @@
FROM python
LABEL maintainer="Kenneth van Ewijk <hasscall@kvewijk.nl>"
VOLUME /app
WORKDIR /usr/src/app
ENV HASSCALL_DATA_FOLDER="/app"
COPY requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD [ "python", "main.py"]
+1 -1
View File
@@ -8,7 +8,7 @@ class Config():
SECRET_KEY = 'XhR*rJN*EGpyPMUwYd4nNPQP72vbaG'
# This will create a file in <app> FOLDER
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'hasscall.sqlite3')
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(os.environ.get("HASSCALL_DATA_FOLDER", basedir), 'hasscall.sqlite3')
SQLALCHEMY_TRACK_MODIFICATIONS = False
class Defaults():
-1
View File
@@ -1,7 +1,6 @@
import collections
from html import entities
from homeassistant_api import Client, HomeassistantAPIError
from pyparsing import matchPreviousExpr
URL = "https://home.kvanewijk.nl:42728/api"
TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI0YmQ4ZDEzY2JkYTI0NTdhYWI5YWIzMWU0MTE2Y2FhMCIsImlhdCI6MTY0NzgwMjgxMCwiZXhwIjoxOTYzMTYyODEwfQ.bwXhX7au5MKtHxl-Trj7tLijjATvRaA45iNhTmL0NyM"
+5
View File
@@ -0,0 +1,5 @@
# Requirements for Hasscall
Flask
Flask-SQLAlchemy
homeassistant-api
Werkzeug
+112
View File
@@ -0,0 +1,112 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile '.\Hasscall\requirements.in'
#
aiodns==3.0.0
# via aiohttp
aiohttp[speedups]==3.8.3
# via
# aiohttp-client-cache
# homeassistant-api
aiohttp-client-cache==0.6.1
# via homeassistant-api
aiosignal==1.3.1
# via aiohttp
appdirs==1.4.4
# via requests-cache
async-timeout==4.0.2
# via aiohttp
attrs==21.4.0
# via
# aiohttp
# aiohttp-client-cache
# cattrs
# requests-cache
brotli==1.0.9
# via aiohttp
cattrs==22.2.0
# via requests-cache
certifi==2022.12.7
# via requests
cffi==1.15.1
# via pycares
charset-normalizer==2.1.1
# via
# aiohttp
# requests
click==8.1.3
# via flask
colorama==0.4.6
# via click
exceptiongroup==1.0.4
# via cattrs
flask==2.2.2
# via
# -r .\Hasscall\requirements.in
# flask-sqlalchemy
flask-sqlalchemy==3.0.2
# via -r .\Hasscall\requirements.in
frozenlist==1.3.3
# via
# aiohttp
# aiosignal
greenlet==2.0.1
# via sqlalchemy
homeassistant-api==4.0.1
# via -r .\Hasscall\requirements.in
idna==3.4
# via
# requests
# yarl
itsdangerous==2.1.2
# via
# aiohttp-client-cache
# flask
jinja2==3.1.2
# via flask
markupsafe==2.1.1
# via
# jinja2
# werkzeug
multidict==6.0.3
# via
# aiohttp
# yarl
pycares==4.2.2
# via aiodns
pycparser==2.21
# via cffi
pydantic==1.9.0
# via homeassistant-api
python-forge==18.6.0
# via aiohttp-client-cache
requests==2.28.1
# via
# homeassistant-api
# requests-cache
requests-cache==0.9.7
# via homeassistant-api
simplejson==3.18.0
# via homeassistant-api
six==1.16.0
# via url-normalize
sqlalchemy==1.4.44
# via flask-sqlalchemy
typing-extensions==4.4.0
# via pydantic
url-normalize==1.4.3
# via
# aiohttp-client-cache
# requests-cache
urllib3==1.26.13
# via
# requests
# requests-cache
werkzeug==2.2.2
# via
# -r .\Hasscall\requirements.in
# flask
yarl==1.8.2
# via aiohttp