mirror of
https://github.com/cupcakearmy/docker-static.git
synced 2024-12-21 07:46:30 +00:00
71 lines
1.3 KiB
Markdown
71 lines
1.3 KiB
Markdown
# NGINX Static Server
|
|
|
|
![Docker Pulls](https://img.shields.io/docker/pulls/cupcakearmy/static?style=flat-square)
|
|
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/cupcakearmy/static/latest?style=flat-square)
|
|
![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/cupcakearmy/static/latest?style=flat-square)
|
|
|
|
This is a little docker image for hosting static content efficiently.
|
|
**Supports ETags & Brotli/GZip** compression out of the box.
|
|
|
|
Automatically builds the latest mainline and stable releases weekly.
|
|
|
|
## Features
|
|
|
|
- Brotli & GZip
|
|
- ETag
|
|
- No server tokens
|
|
|
|
## Tags
|
|
|
|
Tags follow the official nginx naming convention.
|
|
|
|
- `mainline`, same as `latest`
|
|
- `stable`
|
|
- Specific version
|
|
|
|
## Quickstart 🚀
|
|
|
|
```yaml
|
|
# docker-compose.yml
|
|
version: '3.7'
|
|
|
|
services:
|
|
server:
|
|
image: cupcakearmy/static
|
|
restart: unless-stopped
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- ./public:/srv:ro
|
|
```
|
|
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
### Custom Configuration
|
|
|
|
```
|
|
# my.conf
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
location / {
|
|
root /srv;
|
|
try_files $uri /index.html =404;
|
|
}
|
|
}
|
|
```
|
|
|
|
```yaml
|
|
version: '3.7'
|
|
|
|
services:
|
|
server:
|
|
# ...
|
|
volumes:
|
|
- ./my.conf:/usr/local/nginx/conf/sites/default.conf
|
|
# ...
|
|
```
|