From 2b886fe2f64ac5a2212ec089ee8b47cc4c9c6536 Mon Sep 17 00:00:00 2001 From: Sergiusz Warga Date: Thu, 15 Oct 2020 23:47:29 +0200 Subject: [PATCH] Introduced docker --- Dockerfile | 24 ++++++++++++++++++++++++ entrypoint.sh | 3 +++ latin.sqlite | Bin 12288 -> 12288 bytes requirements.txt | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 Dockerfile create mode 100644 entrypoint.sh create mode 100644 requirements.txt 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 934230838bbfe32c08f5a7404f6b0c41b125f47a..6a8a4645d8a3d53ad21657816d9c6fe45c5e449c 100644 GIT binary patch delta 420 zcmZojXh@hK&B#7c#+i|QW5N=CA$ERt2L6ZqoA@X2=kxpUYw)vg78Ll%S1-@b!r;i5 zlbW8dqW~mRi&DXKCWuTfDa~b8Vq;-&XUs@UN(HI_Q6LpSx)i7cNM!=mFe$RKFt{?N zCzhsw6oF}ws`SLN%;M5wg<_x*c@~g8Wtm_VAPS_QEYm0jXbebIE|UT?&=Ai2qCB7x zKr#`e07RDoRpb{X0`1XdVqu8qoV-(CbMixZWuTXY8TcRbhwvNm3-fQ~pTb`X^wM9x pdO2o%9%5HyCg2@51!nx7VFlTM;T4!qlyg}?2H^7u^W?4i-T-~!ey0Ec delta 70 zcmZojXh@hK&B!uQ#+i|2W5N=C4krFh4EzuIH*Ho__{2A{VGEls6AME;=j5IGnv);O VD+A@XGVnj<-wKuAK6$IYHvj~_7hC`U 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