In this post I'm sharing with you a short project for deploying both static content and a backend application with nginx as a reverse proxy using https to serve:
Nginx as a reverse proxy helps to have a single point of https access for serving both the web and the API.
You don't need to have installed in your host nothing but the docker and docker-compose.
The source code can be found at github.com/ctranoris/docker-compose-nginx-jetty-mysql
the main docker-compose.yaml file deploys the three containers and exposes ports and links like the following images shows:
Some things to know:
mysql\data are exposed to your host
a simple
docker-compose up -d
should bring the three containers up.
Use
docker ps
to check if everything is up and running. For example:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESbbc7945bf4d2 jetty "/docker-entrypoin..." 46 hours ago Up 42 hours 0.0.0.0:8080->8080/tcp ajettyb1856eea6f4a mysql:5.7 "docker-entrypoint..." 46 hours ago Up 42 hours 0.0.0.0:3306->3306/tcp amysqlb3937638ed65 nginx "nginx -g 'daemon ..." 46 hours ago Up 42 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp anginx
With
docker exec -it ajetty bash
you can connect to a container with a terminal. or with
docker attach ajetty
you can attach to the container and monitor the output of the executed command in the container.
Recent comments
13 years 14 weeks ago
13 years 16 weeks ago
13 years 17 weeks ago
13 years 18 weeks ago
13 years 19 weeks ago
13 years 19 weeks ago
13 years 19 weeks ago
13 years 19 weeks ago
13 years 21 weeks ago
13 years 21 weeks ago