• Stars
    star
    156
  • Rank 232,678 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dockerfile for Dynamic Image Transformation Server with Nginx and Small Light module

Nginx Image Server

Docker Repository on Quay.io 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 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

# 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=<YOUR-BUCKET-NAME>.s3.amazonaws.com" \
    quay.io/wantedly/nginx-image-server:latest

Then you can try image-processing by accessing

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

And http://<YOUR-SERVER.com>: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:

$ 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

# 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

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 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

MIT License

More Repositories

1

swift-rss-sample

An RSS reader app written in Swift
Swift
461
star
2

apig

[MOVED TO NEW REPO] Golang RESTful API Server Generator
Go
327
star
3

machine-learning-round-table

Gather around the table, and have a discussion to catch up the latest trend of machine learning 🤖
296
star
4

learning-resources

エンジニア向け教材集
220
star
5

step-pretty-slack-notify

Posts wercker build/deploy status to a Slack channel
Ruby
88
star
6

hi18n

message internationalization meets immutability and type-safety
TypeScript
87
star
7

react-declassify

say goodbye to class components
TypeScript
85
star
8

subee

✉️ 🐝 It's not only a bee, but a message - Pub/Sub Worker Framework Implementation
Go
48
star
9

proto-graphql-rust

[EXPERIMENTAL] Generate GraphQL schema and gateway from Proto definitions.
Rust
33
star
10

recsys2020-challenge

Python
32
star
11

microservices_monday

Monday is a good day to talk about Microservices
31
star
12

gorm-zap

Alternative logging with zap for GORM ⚡️
Go
30
star
13

iosdc2018-reactorkit

iOSDC2018 ReactorKitで作る実践iOS App
Swift
29
star
14

frolint

Frontend linter for developers
TypeScript
28
star
15

dockertags

Retrieve available Docker image tag list from image repository
Go
27
star
16

the_pb

Utility for Google Protocol Buffers
Ruby
26
star
17

pq2gorm

Generate gorm model structs from PostgreSQL database schema
Go
25
star
18

computed_model

Batch loader with dependency resolution and computed fields
Ruby
25
star
19

grpc_access_logging_interceptor

An interceptor for access logging with gRPC.
Ruby
18
star
20

frontend-night

Tuesday is a good day to talk about Frontend
17
star
21

ios_night

Let's talk about iOS development -- iOS Night 📱🌙 You might apply to this meetup from
17
star
22

grpc_opencensus_interceptor

An interceptor for using OpenCensus with gRPC.
Ruby
16
star
23

grpc_newrelic_interceptor

An interceptor for using New Relic with gRPC.
Ruby
16
star
24

pb-serializer

Serialize Ruby objects to Protocol Buffers
Ruby
15
star
25

intern-info

Wantedlyのインターン情報や新卒採用についてのインフォメーションです
12
star
26

open_api_annotator

OpenAPI spec generation by bottom-up.
Ruby
11
star
27

kubefork-controller

Go
11
star
28

aws-es-auth-proxy

Authentication Proxy for Amazon Elasticsearch Service
11
star
29

gcpc

Google Cloud Pub/Sub client for Ruby
Ruby
11
star
30

grpc-gateway-study

sample code for grpc-gateway study #grpc_gateway_wt
Shell
10
star
31

open_api

Provide PORO and serializers for OpenAPI v3.0.1
Ruby
9
star
32

canary-controller

Custom Resource and Controller for managing Canary server.
Go
9
star
33

kubernetes-code-reading-party

Kubernetes 読書会
8
star
34

psych-comments

Brings comment-aware parsing to Psych, Ruby's YAML parser
Ruby
8
star
35

kong-on-kubernetes

Shell
6
star
36

sketch-wt-design

[Deprecated] Sketch plugin for Wantedly Design System
JavaScript
6
star
37

apiblueprint-rails

apiblueprint-rails creates API Blueprint boilerplate when calling 'rails g apiblueprint'.
Ruby
6
star
38

ctmcp-reading

Reading: "Concepts, Techniques, and Models of Computer Programming"
5
star
39

raycast-dev-docs

TypeScript
5
star
40

boilerplate

[deprecated] 新しいサービス用のレポジトリを作るときに模範にしてもらいたい構成
Ruby
5
star
41

grpc_typechecker

A dynamic type checker for gRPC methods
Ruby
4
star
42

dockerfile-locust

Docker Image packaging for locust
Dockerfile
4
star
43

deployment-duplicator

Go
4
star
44

wantedly.github.io

Wantedly Engineer Blog (retired)
HTML
4
star
45

ev-cli

CLI tool for managing evaluation data
Go
3
star
46

grpc_server

Simple utility class for using gRPC server
Ruby
3
star
47

activerecord-lookml

[Experimental] ActiveRecord extension for LookML (Looker)
Ruby
3
star
48

dockerfile-terraform

Docker image packaging for Terraform
Ruby
3
star
49

Cerberus

📅 Our room keeper
Swift
3
star
50

developers-account-mapper

Convert a username to other account usernames associated with the user.
Go
3
star
51

opencensus-datadog

Ruby
3
star
52

omniauth-wantedly

Wantedly OAuth2 Strategy for OmniAuth gem.
Ruby
3
star
53

gophers-code-reading-party

ʕ ◔ϖ◔ʔ
2
star
54

k8nskel

Kubernetes Controller to distribute Secrets to new Namespace on Kubernetes.
Go
2
star
55

shisucon2019-teppei-haruki

SHInsotsu iSUCON
Ruby
2
star
56

fmparser

FieldMask parameter parser
Ruby
2
star
57

webmock-proxy

Go
2
star
58

dockerfile-crontab-docker

Docker Image for crontab + Docker
Ruby
2
star
59

hands-on-native-esm-2022

Hands-on Native ESM @ JSConf JP 2022
JavaScript
2
star
60

docker-dd-trace-agent

Datadog agent for trace agent
1
star
61

apib-sample

0512 API Blueprint速習会
Ruby
1
star
62

kubedeploy

Display and update images of Kubernetes deployment
Go
1
star
63

refineimg

Go
1
star
64

dockerfile-sidekiq-prometheus-exporter

Dockerfile for sidekiq-prometheus-exporter
Ruby
1
star
65

grpcutil

Utilities of gRPC server / client for Golang
Go
1
star
66

private-isucon-2018-kobayang-bgpat

HTML
1
star
67

rigger

Custom Resource and Controller to collect Secrets from all Namespaces and sync to specific Namespace.
Go
1
star
68

istio-ruby

Ruby gem for Istio service mesh (https://istio.io/)
Ruby
1
star
69

kong-frontend

Go
1
star
70

angular-notification-banner

angular notification banner
JavaScript
1
star
71

reloader_interceptor

A gRPC interceptor for using ActiveSupport::Reloader.
Ruby
1
star
72

graphql-server-for-selection

フロントエンドエンジニア採用の技術選考用のサンプルGraphQLサーバー
TypeScript
1
star