FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
RUN apk update && apk add bash
Refer to docker-compose.yaml.
In the path ./reverse-proxy/nginx.conf
we define proxy directive help
passed to original server. But in the development process, we need change on a regular basis. Mount it
to local directory will a good solution for easy for using.
ports:
- 8080:8080
- 8081:8081
+ volumes:
+ - ./reverse-proxy/nginx.conf:/etc/nginx/nginx.conf
# restart: always
For any reason, we need cache between original server to reverse proxy. Nginx support config cache with expire time, limit size of cache...
- Docker Compose Nginx Reverse Proxy Multiple Containers https://www.bogotobogo.com/DevOps/Docker/Docker-Compose-Nginx-Reverse-Proxy-Multiple-Containers.php
- Introduction to Docker Compose - https://www.baeldung.com/ops/docker-compose