commit e40b26bc056ae30c45644cafe98bbeafb592c307 Author: Dessa Simpson Date: Thu Oct 13 07:16:08 2022 +0000 Initial commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1e7a0ab --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "0x0"] + path = 0x0 + url = https://git.0x0.st/mia/0x0 diff --git a/0x0 b/0x0 new file mode 160000 index 0000000..afb5811 --- /dev/null +++ b/0x0 @@ -0,0 +1 @@ +Subproject commit afb581187981b56d29e7b11c15c5fce08c0899a6 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4b9d62f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine + +VOLUME /app/instance +WORKDIR /app + +RUN ln -s /app/cleanup.py /etc/periodic/daily/ +RUN apk add s6 python3 libmagic py3-alembic py3-jinja2 py3-flask py3-pip py3-wheel py3-numpy py3-sqlalchemy py3-requests py3-greenlet uwsgi uwsgi-python3 +RUN mv /etc/crontabs/root /etc/crontabs/uwsgi +COPY --chown=uwsgi 0x0 /app +RUN pip install -r requirements.txt +COPY services /services + +CMD ["/bin/s6-svscan","/services"] diff --git a/instance/config.py b/instance/config.py new file mode 100644 index 0000000..ad5f6ba --- /dev/null +++ b/instance/config.py @@ -0,0 +1,2 @@ +SQLALCHEMY_DATABASE_URI="sqlite:///app/instance/db.sqlite" +FHOST_STORAGE_PATH="/app/instance/upload" diff --git a/instance/upload/.gitignore b/instance/upload/.gitignore new file mode 100644 index 0000000..34211e2 --- /dev/null +++ b/instance/upload/.gitignore @@ -0,0 +1,3 @@ +* +!*/ +!.gitignore diff --git a/services/cron/run b/services/cron/run new file mode 100755 index 0000000..4e17819 --- /dev/null +++ b/services/cron/run @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/sbin/crond -f -l 2 diff --git a/services/uwsgi/run b/services/uwsgi/run new file mode 100755 index 0000000..f98639d --- /dev/null +++ b/services/uwsgi/run @@ -0,0 +1,9 @@ +#!/bin/sh +cd /app +exec /usr/sbin/uwsgi --uid uwsgi \ + --plugins python3 \ + --http-socket :8080 \ + --wsgi-file fhost.py \ + --callable app \ + --processes 2 \ + --threads 4