diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c613636 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:3.15 + +RUN apk --update add redis + +ENV PYTHONUNBUFFERED=1 + +RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python +RUN python3 -m ensurepip +RUN pip3 install --no-cache --upgrade pip setuptools + +ADD . /var/www/plugin-server + +WORKDIR /var/www/plugin-server/ + +RUN pip install -r requirements.txt + +RUN ln -s /var/www/plugins ./plugins + +CMD sh start.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..670e31a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + main: + build: + context: ./ + dockerfile: Dockerfile + restart: always + volumes: + - /home/ozbolt/plugins:/var/www/plugins + ports: + - "8085:5000" diff --git a/plugin-server.py b/plugin-server.py index ce16659..72b9d81 100644 --- a/plugin-server.py +++ b/plugin-server.py @@ -50,7 +50,7 @@ def generate_etag(N=12): def return_file(path, plugin=None): - full_path = path if plugin is None else"{}/{}".format(plugin, path) + full_path = path if plugin is None else "plugins/{}/{}".format(plugin, path) if not os.path.isfile(full_path): return "File not found", 404 diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..bb12751 --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +/usr/bin/redis-server & +python plugin-server.py \ No newline at end of file