diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4cb050d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:current-alpine +COPY . /app/ +WORKDIR /app +ENV NODE_ENV=production +RUN yarn install && yarn build && rm -rf node_modules + + +FROM python:3-slim-buster + +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 +ENV DATABASE_URL sqlite:////data/app.db +ENV FLASK_APP app +ENV FLASK_DEBUG 0 +COPY ./requirements.txt /requirements.txt +RUN apt-get update && \ + apt-get install -y gosu && \ + rm -rf /var/lib/apt/lists/* && \ + pip install -r /requirements.txt && pip install gunicorn +COPY --from=0 /app/ /app +WORKDIR /app +RUN flask digest compile +ENTRYPOINT ["/app/entrypoint.sh"] +CMD ["gunicorn", "--bind", "0.0.0.0:5000", "main:app"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..5c14664 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash +chown -R www-data:www-data /data +flask db upgrade && gosu www-data "$@" \ No newline at end of file diff --git a/latin.sqlite b/latin.sqlite index 9342308..6a8a464 100644 Binary files a/latin.sqlite and b/latin.sqlite differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ad4d6a0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,34 @@ +appdirs==1.4.3 +CacheControl==0.12.6 +certifi==2019.11.28 +chardet==3.0.4 +click==7.1.2 +colorama==0.4.3 +contextlib2==0.6.0 +distlib==0.3.0 +distro==1.4.0 +Flask==1.1.2 +Flask-SQLAlchemy==2.4.4 +Flask-WTF==0.14.3 +gunicorn==20.0.4 +html5lib==1.0.1 +idna==2.8 +ipaddr==2.2.0 +itsdangerous==1.1.0 +Jinja2==2.11.2 +lockfile==0.12.2 +MarkupSafe==1.1.1 +msgpack==0.6.2 +packaging==20.3 +pep517==0.8.2 +progress==1.5 +pyparsing==2.4.6 +pytoml==0.1.21 +requests==2.22.0 +retrying==1.3.3 +six==1.14.0 +SQLAlchemy==1.3.19 +urllib3==1.25.8 +webencodings==0.5.1 +Werkzeug==1.0.1 +WTForms==2.3.3