DMTF / Redfish-Mockup-Server

A simple Python 3.4 program that can be copied into a folder at the top of any Redfish mockup and can serve Redfish requests on the specified IP/port.
Other
83 stars 37 forks source link

Docker: Handle signals #89

Closed jrtitus closed 2 years ago

jrtitus commented 2 years ago

docker-compose down / docker-stop after the server is started and healthy results in the container taking the maximum 10s to stop with exit code 137 (SIGKILL).

Run Server

$ docker run -p 8000:8000 dmtf/redfish-mockup-server
Redfish Mockup Server, version 1.1.8
Hostname: 0.0.0.0
Port: 8000
Mockup directory path specified: public-rackmount1
Response time: 0 seconds
Serving Mockup in absolute path: /usr/src/app/public-rackmount1
Serving Redfish mockup on port: 8000
running Server...
('GET', '/redfish/v1')
   GET: Headers: Host: 127.0.0.1:8000
User-Agent: curl/7.74.0
Accept: */*

127.0.0.1 - - [07/Aug/2022 17:44:44] "GET /redfish/v1 HTTP/1.1" 200 -

Docker commands

$ docker ps
CONTAINER ID   IMAGE                        COMMAND                  CREATED          STATUS                    PORTS                                       NAMES
67e7a97f08aa   dmtf/redfish-mockup-server   "python /usr/src/app…"   36 seconds ago   Up 34 seconds (healthy)   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp   boring_visvesvaraya

$ docker stop 67e7a97f08aa
67e7a97f08aa

$ docker container ls -a
CONTAINER ID   IMAGE                        COMMAND                  CREATED              STATUS                       PORTS     NAMES
67e7a97f08aa   dmtf/redfish-mockup-server   "python /usr/src/app…"   About a minute ago   Exited (137) 7 seconds ago             boring_visvesvaraya