diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..80cbcdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3-alpine + +WORKDIR /utils +COPY . . +RUN pip install --no-cache-dir -r requirements-prod.txt + +ENTRYPOINT [ "gunicorn", "-w", "4", "app.app", "--bind", "0.0.0.0:8000" ] + diff --git a/README.md b/README.md index cb4447e..180771a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # utils -Flask app with a few utilities \ No newline at end of file +Flask app with a few utilities. + +## Hosting + +Hosting this is easy: + +- Clone the repo +``` +git clone https://git.everypizza.im/n/utils.git +``` +- Modify the port in `compose.yml` if needed +- Start the container: +``` +podman compose up -d +``` diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..bc7eda0 --- /dev/null +++ b/compose.yml @@ -0,0 +1,9 @@ +services: + utils: + build: + dockerfile: Dockerfile + ports: + - "65193:8000" # Will listen on port 65193, change that number to change the port + restart: unless-stopped + volumes: + - ./utils:/utils diff --git a/requirements-prod.txt b/requirements-prod.txt new file mode 100644 index 0000000..6a40de2 --- /dev/null +++ b/requirements-prod.txt @@ -0,0 +1,3 @@ +flask +bleach +gunicorn diff --git a/requirements.txt b/requirements.txt index 70e2e57..ee11288 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ flask -bleach \ No newline at end of file +bleach