Sign inSign up

steebchen/test-nginx

By steebchen

•Updated almost 8 years ago

Provides the Test::Nginx::Socket utility as a docker image.

Image
0

263

steebchen/test-nginx repository overview

⁠Test::Nginx Docker Image

Provides the Test::Nginx::Socket⁠ utility as a docker image. We use the Test::Nginx::Socket image because it fixes a lot of things in the normal Test::Nginx⁠ package.

⁠Quickstart

To run your nginx tests, use the following dockerfile.

FROM steebchen/nginx-test
COPY . ./

No CMD instruction is needed, as the base image automatically runs prove. It also uses tini⁠ so signals work properly.

Now simply build & run the container as follows to run your tests.

docker build my-tests .
docker run my-tests

⁠Setting environment variables

If you need to use environment variables, simply specific them in your dockerfile as follows or with the --env docker CLI flag.

FROM steebchen/nginx-test

ENV TEST_NGINX_CLIENT_PORT=80
ENV TEST_NGINX_NO_NGINX_MANAGER=1

COPY . ./

⁠Use external nginx instance

When running your own nginx instance like I do in the example above, you can provide another container's network to reach it:

docker build -t my-tests .
docker run --network container:my-app my-tests

Tag summary

Content type

Image

Digest

Size

199.7 MB

Last updated

almost 8 years ago

docker pull steebchen/test-nginx