feat: import from ForgeFlux/ftest/nginx
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2023-10-03 23:36:52 +05:30
commit 34f7b11ece
Signed by: realaravinth
GPG key ID: F8F50389936984FF
5 changed files with 56 additions and 0 deletions

20
.woodpecker.yml Normal file
View file

@ -0,0 +1,20 @@
pipeline:
build_docker_img:
image: plugins/docker
when:
event: [pull_request]
settings:
dry_run: true
repo: forgeflux/ftest-nginx-proxy
tags: latest
build_and_publish_docker_img:
image: plugins/docker
when:
event: [push, tag, deployment]
settings:
username: forgeflux
password:
from_secret: DOCKER_TOKEN
repo: forgeflux/ftest-nginx-proxy
tags: latest

2
Dockerfile Normal file
View file

@ -0,0 +1,2 @@
FROM nginx
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

11
README.md Normal file
View file

@ -0,0 +1,11 @@
[![status-badge](https://ci.batsense.net/api/badges/94/status.svg)](https://ci.batsense.net/repos/94)
---
ftest creates a Docker network called `ftest` and runs job containers on
it. Job containers upload results back to the ftest server. This should
work fine, when ftest server is running as a container and is part of
the container network. But when developing or when using the (WIP) CLI
tool, this isn't feasible.
So this simple nginx proxy configuration exists to expose ftest server
running on port 29130 on host machine to the ftest network.

9
init.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
docker run \
-d \
--name=ftest \
-p 9080:9000 \
--network=ftest \
--add-host ftest_backend:`/sbin/ip route|awk '/default/ { print $9}'`\
forgeflux/ftest-nginx

14
nginx.conf Normal file
View file

@ -0,0 +1,14 @@
server {
listen 9000;
server_name ftest default_server;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://ftest_backend:29130/;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}