Add fast reverse proxy docker compose

From https://github.com/fatedier/frp
This commit is contained in:
Karel Hrkal 2024-07-18 10:29:26 +02:00
parent fee2afa268
commit dfc244435d
10 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# rename the file to .env
FRP_AUTH_TOKEN=your_auth_token
FRP_DASHBOARD_PASSWORD=your_dashboard_password

1
docker-compose/frpc/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -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"]

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
# rename the file to .env
FRP_AUTH_TOKEN=your_auth_token
FRP_DASHBOARD_PASSWORD=your_dashboard_password

1
docker-compose/frps/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -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"]

View File

@ -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

View File

@ -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 }}"