added a docker dev environment

Signed-off-by: Jan Friedli <jan.friedli@immerda.ch>
This commit is contained in:
JF 2019-07-02 13:22:33 -07:00 committed by jvoisin
parent ac0acded89
commit 9d155d171e
4 changed files with 31 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM python:3.7
ADD . /mat2-web
WORKDIR /mat2-web
RUN apt-get update
RUN apt install -y python3-gi python3-gi-cairo gir1.2-poppler-0.18 \
gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl libgirepository1.0-dev
RUN pip install -r requirements.txt
CMD flask run --host=0.0.0.0

View File

@ -79,6 +79,12 @@ collector cronjob to remove leftover files. Besides, it can create a
the uploads folder, to ensure that the uploaded files won't be recoverable
between reboots.
# Development
Install docker and docker-compose and then run `docker-compose up` to setup
the docker dev environment. Mat2-web is now accessible on your host machine at `localhost:5000`.
Every code change triggers a restart of the app.
If you want to add/remove dependencies you have to rebuild the container.
# Custom templates
You can override the default templates from `templates/` by putting replacements

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '2'
services:
web:
build: .
environment:
- FLASK_APP=main.py
- FLASK_ENV=development
ports:
- "5000:5000"
volumes:
- .:/mat2-web
restart: always

5
requirements.txt Normal file
View File

@ -0,0 +1,5 @@
mutagen==1.42.0
ffmpeg==1.4
bubblewrap==1.2.0
mat2==0.9.0
flask==1.0.3