From f3cd22d8d4932c3303f45d9a4a0049d4b39c8968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Fri, 1 May 2020 01:33:41 +0300 Subject: [PATCH] Added docker support --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb69b6b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3 + +ENV PORT=8000 +ENV TITLE=femtoshare +ENV UID=1000 + +RUN mkdir -p /usr/src/femtoshare/ +RUN mkdir -p /usr/src/femtoshare/files +RUN useradd -u $UID femto + +COPY femtoshare.py /usr/src/femtoshare + +EXPOSE $PORT + + +RUN mkdir -p /files +RUN chown -R femto:femto /files +VOLUME /files +WORKDIR /usr/src/femtoshare +USER femto + +CMD python femtoshare.py --public --port $PORT --files-dir /files --title $TITLE \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5cd41d2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3.7' +services: + femtoshare: + build: + context: . + dockerfile: Dockerfile + ports: + - 8000:8000 + image: femtoshare:latest + restart: always + container_name: femtoshare + environment: + - PORT=8000 + - TITLE=femtoshare + - UID=1000 + user: "1000" + volumes: + - ./files:/files