https://github.com/amirhnajafiz/nginx-reloader
A reloader container for Nginx apps.
https://github.com/amirhnajafiz/nginx-reloader
go golang init-container nginx nginx-docker reloader
Last synced: about 2 months ago
JSON representation
A reloader container for Nginx apps.
- Host: GitHub
- URL: https://github.com/amirhnajafiz/nginx-reloader
- Owner: amirhnajafiz
- Created: 2021-11-13T11:01:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-09T10:34:05.000Z (12 months ago)
- Last Synced: 2025-02-01T23:26:58.470Z (4 months ago)
- Topics: go, golang, init-container, nginx, nginx-docker, reloader
- Language: Go
- Homepage:
- Size: 9.73 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nginx-reloader




## 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/nginxnginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- nginx-var-dir:/usr/share/nginx/html
depends_on:
- nginx-reloadervolumes:
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