summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF2019-07-02 13:22:33 -0700
committerjvoisin2019-07-02 13:22:33 -0700
commit9d155d171e916cd3c2c34f6c50955745f8929e79 (patch)
tree07d55875d4e8e599b3ce0df516483f0a7d502770
parentac0acded89f7d499e22605bded5e2e19cbd8c92f (diff)
added a docker dev environment
Signed-off-by: Jan Friedli <jan.friedli@immerda.ch>
-rw-r--r--Dockerfile8
-rw-r--r--README.md6
-rw-r--r--docker-compose.yml12
-rw-r--r--requirements.txt5
4 files changed, 31 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..5ca3fd8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,8 @@
1FROM python:3.7
2ADD . /mat2-web
3WORKDIR /mat2-web
4RUN apt-get update
5RUN apt install -y python3-gi python3-gi-cairo gir1.2-poppler-0.18 \
6gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl libgirepository1.0-dev
7RUN pip install -r requirements.txt
8CMD flask run --host=0.0.0.0 \ No newline at end of file
diff --git a/README.md b/README.md
index 2e01c14..0ee91ac 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,12 @@ collector cronjob to remove leftover files. Besides, it can create a
79the uploads folder, to ensure that the uploaded files won't be recoverable 79the uploads folder, to ensure that the uploaded files won't be recoverable
80between reboots. 80between reboots.
81 81
82# Development
83Install docker and docker-compose and then run `docker-compose up` to setup
84the docker dev environment. Mat2-web is now accessible on your host machine at `localhost:5000`.
85Every code change triggers a restart of the app.
86If you want to add/remove dependencies you have to rebuild the container.
87
82# Custom templates 88# Custom templates
83 89
84You can override the default templates from `templates/` by putting replacements 90You can override the default templates from `templates/` by putting replacements
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..c5f8b32
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,12 @@
1version: '2'
2services:
3 web:
4 build: .
5 environment:
6 - FLASK_APP=main.py
7 - FLASK_ENV=development
8 ports:
9 - "5000:5000"
10 volumes:
11 - .:/mat2-web
12 restart: always
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..7cab5aa
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,5 @@
1mutagen==1.42.0
2ffmpeg==1.4
3bubblewrap==1.2.0
4mat2==0.9.0
5flask==1.0.3 \ No newline at end of file