百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nginx-image-server

> 编程语言
开源

使用 Nginx 和 Small Light 模块的动态图像转换服务器 Dockerfile

156 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

使用 Nginx 和 Small Light 模块的动态图像转换服务器 Dockerfile

Nginx Image Server

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 https://github.com/cubicdaiya/ngx_small_light for more information about image processing.

SUPPORTED TAGS

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

HOW TO USE

bash
# Get the docker image
$ docker pull quay.io/wantedly/nginx-image-server

# Fetch an example image to try image-processing local image
$ curl -L https://raw.githubusercontent.com/wantedly/nginx-image-server/master/examples/example.jpg > \
    /tmp/example.jpg

# 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 "SERVER_NAME=image.example.com" \
    -e "S3_HOST=.s3.amazonaws.com" \
    quay.io/wantedly/nginx-image-server:latest

Then you can try image-processing by accessing

  • Images in S3: http:///small_light(dh=400,da=l,ds=s)/
  • 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:

FROM quay.io/wantedly/nginx-image-server
COPY nginx.conf /etc/nginx/nginx.conf

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

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

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

HOW TO DEVELOP

bash
# on your local machine
$ git clone https://github.com/wantedly/nginx-image-server.git && cd nginx-image-server
$ script/bootstrap
$ cp .env.sample .env
# .env
TIMEZONE=Asia/Tokyo
$ vagrant up
$ vi Dockerfile

# login to VM and test it
$ vagrant ssh
@core-01 $ cd share
@core-01 $ docker build -t=quay.io/wantedly/nginx-image-server .
@core-01 $ script/test

TEST

Feature(behavior) test

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

bash
$ script/test

Performance test

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

bash
# 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 locustfile.py -H http://${TARGET_IP}

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

LICENSE

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言