frp docker 配置
2023年7月18日...大约 1 分钟
frp_auth docker build
构造一个python3 镜像
FROM alpine
MAINTAINER change
RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.aliyun.com#g' /etc/apk/repositories && \
apk add python3 wget &&\
mkdir /root/frp_auth
ADD get-pip.py /root/get-pip.py
RUN python3 /root/get-pip.py -i https://mirrors.aliyun.com/pypi/simple/ ;pip install flask -i https://mirrors.aliyun.com/pypi/simple/
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
RUN pip install pymysql -i https://mirrors.aliyun.com/pypi/simple/
WORKDIR /root/frp_auth
docker_start.sh 未启用
#!/bin/sh
echo "Download new python scripts .."
wget -q -O - "http://v2.shuobude.top:8888/file/down/linux_arm64_server.tar.gz" | tar -xzf - -C /root/frp_auth/
echo "Start python"
if [ -f /root/frp_auth/main.py ]
then
python3 /root/frp_auth/main.py
else
echo "no config file"
compose 配置
docker compose
frp_auth.yaml
# Use root/example as user/password credentials
version: '3.1'
services:
mysql:
image: mysql:5.7.41
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
command: --default-authentication-plugin=mysql_native_password
restart: always
#network_mode: "host"
container_name: mysql
volumes:
- '/data/frp/mysql/data/frpdir:/var/lib/mysql'
- '/etc/localtime:/etc/localtime'
environment:
MYSQL_ROOT_PASSWORD: Mysql@2023
#ports:
# - 6666:3306
adminer:
container_name: mysql-adminer
image: adminer
restart: always
volumes:
- '/etc/localtime:/etc/localtime'
ports:
- 8888:8080
depends_on:
- mysql
links:
- mysql:db
frp_auth:
restart: always
volumes:
- '/data/frp/frp_auth_mysql:/root/frp_auth'
- '/etc/localtime:/etc/localtime'
environment:
- PUID=0
- PGID=0
- UMASK=022
container_name: frp_auth
image: 'python3'
command: sh -c 'python3 /root/frp_auth/main.py >>/root/frp_auth/python3_run.log 2>&1 '
depends_on:
- mysql
ports:
- 6665:6665
links:
- mysql
frp_auth.yaml
# Use root/example as user/password credentials
version: '3.1'
services:
frp_auth:
restart: always
volumes:
- '/data/frp/frp_auth_mysql:/root/frp_auth'
- '/etc/localtime:/etc/localtime'
environment:
- PUID=0
- PGID=0
- UMASK=022
container_name: frp_auth
image: 'python3'
command: sh -c 'python3 /root/frp_auth/main.py >>/root/frp_auth/python3_run.log 2>&1 '
ports:
- 6665:6665
frps.yaml
version: '3.3'
services:
frps:
restart: always
volumes:
- '/data/frp/bin:/etc/frp'
- '/etc/localtime:/etc/localtime'
network_mode: "host"
environment:
- PUID=0
- PGID=0
- UMASK=022
container_name: frps
image: 'busybox'
command: sh -c 'cp /etc/frp/frps /bin/frps && frps -c /etc/frp/frps.ini'
frp_auth:
restart: always
network_mode: "host"
volumes:
- '/data/frp/frp_auth:/root/frp_auth'
- '/etc/localtime:/etc/localtime'
environment:
- PUID=0
- PGID=0
- UMASK=022
container_name: frp_auth
image: 'python3'
command: sh -c 'python3 /root/frp_auth/main.py >>/root/frp_auth/python3_run.log 2>&1 '
贡献者
changelichangyangccm@163.com