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

Add fast reverse proxy docker compose #364

Open
wants to merge 1 commit into
base: main
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
3 changes: 3 additions & 0 deletions docker-compose/frpc/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# rename the file to .env
FRP_AUTH_TOKEN=your_auth_token
FRP_DASHBOARD_PASSWORD=your_dashboard_password
1 change: 1 addition & 0 deletions docker-compose/frpc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
14 changes: 14 additions & 0 deletions docker-compose/frpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:latest

RUN apk add --no-cache wget tar

ENV FRP_VERSION 0.59.0

RUN wget https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz \
&& tar -xzf frp_${FRP_VERSION}_linux_amd64.tar.gz \
&& mv frp_${FRP_VERSION}_linux_amd64 /frp \
&& rm frp_${FRP_VERSION}_linux_amd64.tar.gz

EXPOSE 7400

ENTRYPOINT ["/frp/frpc", "-c", "/frp/frpc.toml"]
13 changes: 13 additions & 0 deletions docker-compose/frpc/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
services:
frpc:
build: .
container_name: frpc
ports:
- 7400:7400
environment:
FRP_AUTH_TOKEN: ${FRP_AUTH_TOKEN}
FRP_DASHBOARD_PASSWORD: ${FRP_DASHBOARD_PASSWORD}
volumes:
- ./frpc.toml:/frp/frpc.toml
restart: unless-stopped
21 changes: 21 additions & 0 deletions docker-compose/frpc/frpc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
serverAddr = "your-frps-server.com"
serverPort = 7000

auth.method = "token"
auth.token = "{{ .Envs.FRP_AUTH_TOKEN }}"

webServer.addr = "0.0.0.0"
webServer.port = 7400

webServer.user = "admin"
webServer.password = "{{ .Envs.FRP_DASHBOARD_PASSWORD }}"


# Now your (local!) portainer will be avaliable at your-frps-server.com:9000
# (assuming you run frps on your server of course)
[[proxies]]
name = "portainer"
type = "tcp"
localIP = "host.docker.internal"
localPort = 9000
remotePort = 9000
3 changes: 3 additions & 0 deletions docker-compose/frps/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# rename the file to .env
FRP_AUTH_TOKEN=your_auth_token
FRP_DASHBOARD_PASSWORD=your_dashboard_password
1 change: 1 addition & 0 deletions docker-compose/frps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
14 changes: 14 additions & 0 deletions docker-compose/frps/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:latest

RUN apk add --no-cache wget tar

ENV FRP_VERSION 0.59.0

RUN wget https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz \
&& tar -xzf frp_${FRP_VERSION}_linux_amd64.tar.gz \
&& mv frp_${FRP_VERSION}_linux_amd64 /frp \
&& rm frp_${FRP_VERSION}_linux_amd64.tar.gz

EXPOSE 7000 7500

ENTRYPOINT ["/frp/frps", "-c", "/frp/frps.toml"]
12 changes: 12 additions & 0 deletions docker-compose/frps/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
services:
frps:
build: .
container_name: frps
network_mode: host
environment:
FRP_AUTH_TOKEN: ${FRP_AUTH_TOKEN}
FRP_DASHBOARD_PASSWORD: ${FRP_DASHBOARD_PASSWORD}
volumes:
- ./frps.toml:/frp/frps.toml
restart: unless-stopped
10 changes: 10 additions & 0 deletions docker-compose/frps/frps.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bindPort = 7000

auth.method = "token"
auth.token = "{{ .Envs.FRP_AUTH_TOKEN }}"

webServer.addr = "0.0.0.0"
webServer.port = 7500

webServer.user = "admin"
webServer.password = "{{ .Envs.FRP_DASHBOARD_PASSWORD }}"