https://github.com/rixrix/dangx
DangX: Docker + Alpine Linux + NodeJS API + Nginx Reverse Proxy Server
https://github.com/rixrix/dangx
alpine-linux api docker nginx nginx-proxy nodejs
Last synced: 7 months ago
JSON representation
DangX: Docker + Alpine Linux + NodeJS API + Nginx Reverse Proxy Server
- Host: GitHub
- URL: https://github.com/rixrix/dangx
- Owner: rixrix
- License: mit
- Created: 2017-03-13T10:22:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-28T02:10:54.000Z (over 8 years ago)
- Last Synced: 2025-01-23T05:15:26.720Z (about 1 year ago)
- Topics: alpine-linux, api, docker, nginx, nginx-proxy, nodejs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DangX
This is a simple configuration of running a Node.JS API behind Nginx.
```
Docker Container
+---------------------------------------------------+
| |
| ^ + |
| | | :8080 |
| + v |
| |
| +-------------------+ +----------------+ |
| | | :8081 | | |
| | | +---> | | |
| | Nginx | | Node.JS | |
| | | | | |
| | | <---+ | | |
| +-------------------+ +----------------+ |
| |
| |
+---------------------------------------------------+
```
## Technologies
* Docker
* Alpine Linux
* Node.JS
* Nginx
* pm2
## The Setup
* [Alpine](https://alpinelinux.org/) Linux as the main OS
* Node.JS is listening from port `8081`
* Nginx is configured as a Web Server and Reverse Proxy Server
* Web Server
* listen at port `8080`
* http://localhost:8080
* Reverse Proxy Server
* proxy all requests to `/api/xxx`
* eg:
* http://localhost/api/user/list
* http://localhost/api/dashboard/list
* Mounted Folder
* routes, models, *.js are mounted onto the container except for some other files/folders, see .dockerignore
* pm2 manages Node.JS server in `watch` mode. Changes to *.js files triggers a server restart
## Commands
* $ docker-compose up # starts the container
* $ docker-compose up --build # rebuild the image
## References
* https://www.nginx.com/resources/admin-guide/reverse-proxy/
* https://docs.docker.com/compose/overview/
* https://alpinelinux.org/about/
* https://docs.docker.com/engine/reference/builder/
* https://docs.docker.com/engine/reference/commandline/docker/
## License
MIT