-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM rust:1.40.0-alpine as builder | ||
|
||
RUN if [ ! -d /tmp ]; then mkdir /tmp; fi | ||
|
||
WORKDIR /tmp | ||
|
||
COPY Cargo.toml . | ||
COPY Cargo.lock . | ||
COPY src ./src | ||
|
||
RUN cargo build --release | ||
|
||
#------------------------------------------------------------- | ||
FROM alpine:3.11.2 | ||
|
||
RUN apk add --no-cache bash | ||
|
||
COPY --from=builder /tmp/target/release/corsair . | ||
|
||
COPY scripts ./scripts | ||
|
||
# ENV LISTEN_ADDR=127.0.0.1:8000 PROXY_ADDR=127.0.0.1:4000 | ||
CMD ["./scripts/run"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
RED='\033[0;31m' | ||
NC='\033[0m' # No Color | ||
|
||
if [ -z $LISTEN_ADDR ]; then | ||
echo "ERROR - unset environment variable LISTEN_ADDR" | ||
exit 1 | ||
fi | ||
|
||
if [ -z $PROXY_ADDR ]; then | ||
echo "ERROR - unset environment variable PROXY_ADDR" | ||
exit 1 | ||
fi | ||
|
||
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOT_DIR=$(cd $SCRIPTS_DIR/.. && pwd) | ||
|
||
# this is convenient for running the application in a docker container | ||
./corsair --listen-ip=${LISTEN_ADDR} --proxy-ip=${PROXY_ADDR} --permissive | ||
|