iris/_examples/docker
liguoqinjim f98ee4e725 fix .dokerignore to .dockerignore
Former-commit-id: 61ac943adb6efa7afe96662ab46295be2203a1e3
2020-03-19 16:13:47 +08:00
..
.dockerignore fix .dokerignore to .dockerignore 2020-03-19 16:13:47 +08:00
docker-compose.yml add a simple docker example 2020-02-06 18:43:03 +02:00
Dockerfile minor 2020-02-08 13:41:09 +02:00
go.mod Update to version 12.1.8 - Read HISTORY.md 2020-02-16 11:14:35 +02:00
main.go examples: replace all app.Run(iris.Addr(...)) with app.Listen just for the shake of simplicity, both are doing the same exact thing as it's described on the http listening first example. 2020-03-05 22:41:27 +02:00
README.md add a simple docker example 2020-02-06 18:43:03 +02:00

Docker Example

The only requirement for this example is Docker.

Docker Compose

The Docker Compose is pre-installed with Docker for Windows. For linux please follow the steps described at: https://docs.docker.com/compose/install/.

Build and run the application for linux arch and expose it on http://localhost:8080.

$ docker-compose up

See docker-compose file.

Without Docker Compose

  1. Build the image as "myapp" (docker build)
  2. Run the image and map exposed ports (-p 8080:8080)
  3. Attach the interactive mode so CTRL/CMD+C signals are respected to shutdown the Iris Server (-it)
  4. Cleanup the image on finish (--rm)
$ docker build -t myapp . 
$ docker run --rm -it -p 8080:8080 myapp:latest