Skip to content

Adds support for running WebRisk Proxy Server as a container #23

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

Open
wants to merge 2 commits 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
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM golang:alpine


WORKDIR /go/src/webrisk


RUN apk add --update --no-cache git


# Gets the Proxy server binary
RUN go get github.com/google/webrisk/cmd/wrserver


# If you want to run a container with a different API KEY you can just
# pass this variable as `docker run` argument:
# docker run -e WR_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXX
ARG WR_API_KEY


# If you want to change the Proxy server port you can pass this
# variable as `docker run` argument:
# docker run -e WR_PROXY_PORT=5000
ARG WR_PROXY_PORT


# In case no WR_PROXY_PORT is informed, default value is 8080
ENV WR_PROXY_PORT=8080


# Runs the WebRisk Proxy Server
CMD /go/bin/wrserver \
-apikey=${WR_API_KEY} \
-srvaddr=0.0.0.0:${WR_PROXY_PORT} \
-db=/tmp/webrisk.db
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ To use the local proxy server to check a URL, send a POST request to `127.0.0.1:
]
}
```
4. Or, if you would like to run the Proxy server as a container you can do as follows:
```bash
$> docker build --tag webrisk:local .
```
Once the image is built locally, you can run it:
```bash
$> docker run -it --rm -p 8080:8080 -e WR_API_KEY=XXXXXXXXXXX --name webrisk webrisk:local
```

# Command-Line Lookup

Expand Down