Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstroecker/zig-robotstxt
Lightweight docker image for serving a disallow robots.txt file using the zig programming language.
https://github.com/mstroecker/zig-robotstxt
disallow-robots docker robots zig zig-programming-language ziglang
Last synced: 29 days ago
JSON representation
Lightweight docker image for serving a disallow robots.txt file using the zig programming language.
- Host: GitHub
- URL: https://github.com/mstroecker/zig-robotstxt
- Owner: mstroecker
- License: mit
- Created: 2019-09-02T21:30:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T08:23:32.000Z (about 5 years ago)
- Last Synced: 2024-08-03T23:24:26.023Z (4 months ago)
- Topics: disallow-robots, docker, robots, zig, zig-programming-language, ziglang
- Language: Zig
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - mstroecker/zig-robotstxt
README
# Zig robots.txt Docker image
[![Build Status](https://travis-ci.org/mstroecker/zig-robotstxt.svg?branch=master)](https://travis-ci.org/mstroecker/zig-robotstxt)
[![Docker Pulls](https://img.shields.io/docker/pulls/mstroecker/zig-robotstxt)](https://hub.docker.com/r/mstroecker/zig-robotstxt)
[![](https://images.microbadger.com/badges/image/mstroecker/zig-robotstxt.svg)](https://microbadger.com/images/mstroecker/zig-robotstxt "Get your own image badge on microbadger.com")This project implements a small(5.7 KB) and lightweight http-server, just serving a disallow-robots.txt file using the Zig programming language(https://ziglang.org/).
Run using docker run:
```bash
docker run -p 80:8080 mstroecker/zig-robotstxt
```
## Kubernetes ExampleKubernetes configuration example:
```yaml
apiVersion: v1
kind: Namespace
metadata:
name: myservice
---
apiVersion: v1
kind: Service
metadata:
name: robotstxt
namespace: myservice
spec:
type: LoadBalancer
ports:
- port: 81
targetPort: http
name: http
selector:
app: robotstxt
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: robotstxt
namespace: myservice
spec:
replicas: 3
selector:
matchLabels:
app: robotstxt
template:
metadata:
labels:
app: robotstxt
spec:
containers:
- name: robotstxt
image: mstroecker/zig-robotstxt
ports:
- containerPort: 8080
name: http
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: robotstxt
namespace: myservice
spec:
rules:
- host: localhost
http:
paths:
- path: /robots.txt
backend:
serviceName: robotstxt
servicePort: http```
## Docker Compose Example
Compose configuration example with traefik:
```yaml
version: '3'
services:
traefik:
image: traefik:1.7
command:
- "--docker"
- "--docker.watch=true"
ports:
- "80:80"
labels:
traefik.enable: 'false'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rorobotstxt:
image: mstroecker/zig-robotstxt
labels:
- "traefik.port=8080"
- "traefik.robotstxt.frontend.rule=Host:localhost;Path:/robots.txt"
```Result message:
```http
HTTP/1.1 200 OK
Content-Length: 26User-agent: *
Disallow: /```