-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0a753e
commit c4bcaf9
Showing
2 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,71 @@ | ||
# Nginx Reloader | ||
# nginx-reloader | ||
|
||
`Nginx`-reloader is a init-container which replaces your desired web page with the `nginx` default HTML files. Instead of creating Dockerfiles for your frontend applications, you can use `nginx-reloader` container to place your native apps in `usr/share/nginx/html` directory. | ||
![GitHub last commit](https://img.shields.io/github/last-commit/amirhnajafiz/nginx-reloader) | ||
![GitHub issues](https://img.shields.io/github/issues/amirhnajafiz/nginx-reloader) | ||
![GitHub forks](https://img.shields.io/github/forks/amirhnajafiz/nginx-reloader) | ||
![GitHub stars](https://img.shields.io/github/stars/amirhnajafiz/nginx-reloader) | ||
![GitHub license](https://img.shields.io/github/license/amirhnajafiz/nginx-reloader) | ||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/amirhnajafiz/nginx-reloader/CI) | ||
|
||
## Overview | ||
|
||
`nginx-reloader` is an init-container designed to streamline the deployment of frontend applications using nginx by automating the process of replacing default nginx HTML files with those from your own web projects. This tool is perfect for deploying `react.js`, `vue.js`, `angular.js`, or even static HTML applications. | ||
|
||
## Features | ||
|
||
- **Easy Deployment**: Set up your frontend apps with nginx without writing complex Dockerfiles. | ||
- **Flexibility**: Supports various frameworks like React.js, Vue.js, Angular.js, and more. | ||
- **Automation**: Automatically places your built app into the nginx HTML directory. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- Docker installed on your machine. | ||
- Basic knowledge of Docker and containerization. | ||
|
||
### Usage | ||
|
||
Pull the following image: | ||
|
||
```bash | ||
docker pull ghcr.io/amirhnajafiz/nginx-reloader:latest | ||
``` | ||
|
||
A docker-compose example: | ||
|
||
```yaml | ||
version: '3' | ||
services: | ||
nginx-reloader: | ||
image: ghcr.io/amirhnajafiz/nginx-reloader:latest | ||
environment: | ||
- NR_TYPE=clone | ||
- NR_ADDRESS=https://github.com/research-camp/profile.git | ||
- NR_NGINX_HTML_DIR=/etc/nginx-reloader/tmp | ||
- NR_TMP_LOCAL_DIR=/etc/nginx-reloader/nginx | ||
volumes: | ||
- nginx-reloader-data:/etc/nginx-reloader/tmp | ||
- nginx-var-dir:/etc/nginx-reloader/nginx | ||
|
||
nginx: | ||
image: nginx:latest | ||
ports: | ||
- "8080:80" | ||
volumes: | ||
- nginx-var-dir:/usr/share/nginx/html | ||
depends_on: | ||
- nginx-reloader | ||
|
||
volumes: | ||
nginx-reloader-data: | ||
nginx-var-dir: | ||
``` | ||
### Env variables | ||
- `NR_TYPE` : can be clone (for git) or fetch (for normal file download from an address) | ||
- `NR_ADDRESS` : the address of your web-app build content | ||
- `NR_DOWNLOAD_FILENAME` : can be used when you are fetching a file with an address that does not have filename in it | ||
- `NR_NGINX_HTML_DIR` : by default is set to /usr/share/nginx/html | ||
- `NR_TMP_LOCAL_DIR` : by default is set to /etc/nginx-reloader/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters