Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-image: initial commit #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM centos:7

RUN yum -y update && yum clean all
RUN yum -y install epel-release
RUN yum -y install curl wget gc gcc gcc-c++ pcre-devel zlib-devel make wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed gcc automake autoconf apr-util-devel gc gcc gcc-c++ pcre-devel zlib-devel make wget openssl openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed

RUN curl -L https://github.com/duy13/vDDoS-Protection/raw/master/latest.sh -o latest.sh \
&& chmod 700 latest.sh \
&& bash latest.sh

COPY docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["usr/local/bin/docker-entrypoint.sh"]
CMD ["vddos"]
30 changes: 30 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docker image for vDDoS Proxy Protection

https://github.com/duy13/vDDoS-Protection

## Usage example

### Proxying a host application

Consider an application running on host at 127.0.0.1:8000 to be reach via the
vddos proxy container at example.local:80.

1. Add `example.local` host name
For example in your `/etc/hosts`.

2. Insert setup in a file `website.conf` as follow:
```
# Website Listen Backend Cache Security SSL-Prikey SSL-CRTkey
example.local http://0.0.0.0:80 http://127.0.0.1:8000 no no no no
```

3. Execute vddos container:
```
$ docker run --rm --network="host" -v "$PWD/website.conf:/vddos/conf.d/website.conf" trepmag/vddos:latest
```

4. Check:
```
curl http://example.local
...
```
10 changes: 10 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

if [ "$1" = 'vddos' ]; then
vddos start
trap : TERM INT; sleep infinity & wait
vddos stop
fi

exec "$@"