App1 is a Flask web application for practice.
App1 is for practicing application delivery.
-
Build the
app1
Docker image.docker build -t app1 .
-
Run the
app1
Docker container.docker run --rm -it -p 8080:8080 -e FOO=fortytwo app1
Consider the following options:
--rm
: Ensure the container is cleaned up when stopped.-it
: Run App1 in the foreground.-p 8080:8080
: Publish the App1 default listening port 8080 to host port 8080.-e FOO=fortytwo
: Configure the foo setting.
-
Open a separate terminal.
-
Send an HTTP GET request.
curl http://localhost:8080/
The
app1
configuration is returned as JSON. -
Navigate back to the terminal where App1 is running.
-
Shutdown App1.
Press
ctrl
+c
.