media-docker
A dockerized media server module
Tested with proxy-docker ( nginx reverse proxy : https://github.com/DINA-Web/proxy-docker -configured to handle 'large' files )
The media-docker is running on 'wildfly:8.2.1.Final'
configuration to handle 'large' files :
'/subsystem=undertow/server=default-server/http-listener=default/:write-attribute(name=max-post-size,value=1048576000)' , see the file wildfly-custom/customization/commands.cli
Before starting
the default URL for your mediaserver
- The mediaserver is set up with URL = 'api.nrm.se'
- that is configured in the 'docker-compose.yml'
- that is configured in the nginx-conf/mediaserver.conf
- that is configured in the 'mysql-autoload/update-admin_config.sql' (update this file before db-creation)
- that is set for the testing of the server, see /self-test/Makefile
be sure to update the /etc/hosts-file with 'api.nrm.se'
Start up the mediaserver
$ make
before testing : check nr of records in your database : ./self-test/db_count.sh
testing post an image to the mediaserver server
- cd self-test
- $ make ( posts an image with SIZE=1000 and displays the image in firefox )
- default-values are : HOST=api.nrm.se, SIZE = 1000
- increase the size of the image : $ make SIZE=5000
did firefox display the image of the dragon?
After testing : check nr of records in your database : ./self-test/db_count.sh
The response from above posting contains the key 'mediaURL' which contains the URL to the posted image, see [below](https://github.com/Inkimar/dw-media_docker#using-the-api)
Using the Makefile
make
starts the services from scratch ( target 'init' fetches the artifacts)
make clean
stops and removes services and data
###Directories
- './srv/log/', contains wildfly's 'server.log(s)'
- './srv/media/', mediafiles are stored here
For other available actions, please see the Makefile
Using the API
Assuming that the hostname api.nrm.se :
GET against http://api.nrm.se/MediaServerResteasy/media/v1/`uuid`?format=image/jpeg will return an image
Documentation can be found at: https://github.com/DINA-Web/mediaserver-module
Full API docs (in-progress) can be found at: http://docs.media8.apiary.io