Coder Social home page Coder Social logo

docker-compose-sample's Introduction

Docker-compose sample

will the IP change?

Removing/recreating php container does not change its IP, nginx still finds it

terminal 1

make up

open a separate terminal and run make curl_tail to see the response from nginx

inspect the PHP container IP with the following shows its ip is not changing by running the following sequence


$ docker inspect docker-compose-sample_php_1 | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "192.168.80.3",
~/Documents/siti-web/docker-compose-sample > bizmate@bizmate-i7 [php:7.2.24-system]
$ make php_rm
docker-compose rm -sf php
Stopping docker-compose-sample_php_1 ... done
Going to remove docker-compose-sample_php_1
Removing docker-compose-sample_php_1 ... done
~/Documents/siti-web/docker-compose-sample > bizmate@bizmate-i7 [php:7.2.24-system]
$ docker inspect docker-compose-sample_php_1 | grep IPAddress
Error: No such object: docker-compose-sample_php_1
~/Documents/siti-web/docker-compose-sample > bizmate@bizmate-i7 [php:7.2.24-system]
$ make php_recreate 
docker-compose up -d --force-recreate php
WARNING: The UID variable is not set. Defaulting to a blank string.
Creating docker-compose-sample_php_1 ... done
~/Documents/siti-web/docker-compose-sample > bizmate@bizmate-i7 [php:7.2.24-system]
$ docker inspect docker-compose-sample_php_1 | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "192.168.80.3",
                    

see sample nginx responses below

curl_1   | HTTP/1.1 200 OK
curl_1   | Server: nginx/1.17.9
curl_1   | Date: Mon, 04 May 2020 01:50:40 GMT
curl_1   | Content-Type: text/html; charset=UTF-8
curl_1   | Transfer-Encoding: chunked
curl_1   | Connection: keep-alive
curl_1   | X-Powered-By: PHP/7.4.5
curl_1   | 
curl_1   | Server IP Address is: 192.168.80.4 

...
curl_1   | HTTP/1.1 504 Gateway Time-out
curl_1   | Server: nginx/1.17.9
curl_1   | Date: Mon, 04 May 2020 01:54:19 GMT
curl_1   | Content-Type: text/html
curl_1   | Content-Length: 167
curl_1   | Connection: keep-alive
curl_1   | 
curl_1   | <html>
curl_1   | <head><title>504 Gateway Time-out</title></head>
curl_1   | <body>
curl_1   | <center><h1>504 Gateway Time-out</h1></center>
curl_1   | <hr><center>nginx/1.17.9</center>
curl_1   | </body>
curl_1   | </html>


...

curl_1   | Server IP Address is: 192.168.80.4 
curl_1   | HTTP/1.1 200 OK
curl_1   | Server: nginx/1.17.9
curl_1   | Date: Mon, 04 May 2020 01:55:06 GMT
curl_1   | Content-Type: text/html; charset=UTF-8
curl_1   | Transfer-Encoding: chunked
curl_1   | Connection: keep-alive
curl_1   | X-Powered-By: PHP/7.4.5
curl_1   | 
curl_1   | Server IP Address is: 192.168.80.4 



docker-compose-sample's People

Contributors

bizmate avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.