Images Web Server is an example app written in Python used on Docker classes. The app serves images.
Install module dependenices with PIP:
pip3 install -r requirements.txt
The following modules (and their dependencies) will be installed:
- Bottle
- requests
- gunicorn (for "production" environments)
python3 app.py
will run the server in development / debug mode using port 3000. You can open the site using http://localhost:3000/ .
gunicorn --bind 0.0.0.0:8000 --workers 3 app:app
will run the server in "production" mode on port 8000.
By default the server serves *.jpg, *.jpeg and *.png image files found in the images
folder.
If an environment variable called IMAGE_SRV
is found then the server tries to load the http://IMAGE_SRV/remote-images.txt
file when starting up. If file is not found, the server exists. If the file is found then the images listed inside will be proxied on the page displayed by Images Web Server. The images should be available at http://IMAGE_SRV/filename.ext.
image_file1.jpg
image_file2.png
<no newline at the end>