Skip to content
Dockerfile for Dynamic Image Transformation Server with Nginx and Small Light module
Ruby Shell Dockerfile HTML Perl Python
Branch: master
Clone or download

Latest commit

Latest commit 72b059f Aug 21, 2019


Type Name Latest commit message Commit time
Failed to load latest commit information.
coreos Use beta channel as default Aug 10, 2015
files Return 400 if resize parameter is invalid Jan 20, 2015
script Use image Mar 12, 2015
.dockerignore Add essential files only to Docker context May 18, 2016
.travis.yml notification to slack Nov 30, 2015
Dockerfile Fix ordering Aug 20, 2019
LICENSE Update years in LICENSE Jul 8, 2016 Update Aug 20, 2019
wercker.yml Don't use target as image name Mar 2, 2015

Nginx Image Server

Docker Repository on Build Status

Docker Image for Nginx server for image processing with ngx_small_light. It supports resizing/cropping/formatting (png, webp...etc) of images stored in local storages or AWS S3.

Please see for more information about image processing.


  • latest
    • Nginx 1.10.0
    • ngx_small_light 0.9.1
    • ImageMagick 6.8.6-8 (Q16) with WebP support


# Get the docker image
$ docker pull

# Fetch an example image to try image-processing local image
$ curl -L > \

# Start the image server
$ docker run \
    --rm \
    -it \
    --name nginx-image-server \
    -p 80:80 \
    -p 8090:8090 \
    -v /tmp/example.jpg:/var/www/nginx/images/example.jpg \
    -e "" \

Then you can try image-processing by accessing

  • Images in S3: http://<>/small_light(dh=400,da=l,ds=s)/<PATH-TO-IMAGE-IN-S3>
  • Images in Local: http://<>/local/small_light(dh=400,da=l,ds=s)/images/example.jpg

And http://<>:8090/status retruns the nginx status.

Custom configuration

You can build a docker image includes your own nginx.conf:

COPY nginx.conf /etc/nginx/nginx.conf

Then build with docker build -t your-nginx-image-server . and run:

$ docker run \
    -d \
    --name your-nginx-image-server \
    -p 80:80 \

Be sure to include daemon off; in your custom configuration to run Nginx in the foreground. Otherwise your container will stop immediately after starting.


# on your local machine
$ git clone && cd nginx-image-server
$ script/bootstrap
$ cp .env.sample .env
# .env
$ vagrant up
$ vi Dockerfile

# login to VM and test it
$ vagrant ssh
@core-01 $ cd share
@core-01 $ docker build .
@core-01 $ script/test


wercker status

Feature(behavior) test

Behavior test with infrataster. Test files are under test/feature directory. You can run this test with follwing script:

$ script/test

Performance test

Performance test with locust. Test files are under test/performance directory. You can run locust with follwing script:

# Run target container
$ script/run

# Export target IP
$ export TARGET_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' nginx-image-server)

# Run locust as WebTool
$ script/run-locust -f -H http://${TARGET_IP}

# Run locust as CLI
$ script/run-locust -f -H http://${TARGET_IP} --no-web -c 5 -r 1 -n 10


MIT License

You can’t perform that action at this time.