websoft9/docker/proxy/Dockerfile

25 lines
1.5 KiB
Text
Raw Normal View History

2024-04-10 03:43:57 +00:00
# modify time: 202404101148, you can modify here to trigger Docker Build action
2023-10-25 07:33:30 +00:00
# from Dockerfile: https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile
# from image: https://hub.docker.com/r/jc21/nginx-proxy-manager
2024-03-26 05:47:18 +00:00
FROM jc21/nginx-proxy-manager:2.11.1
2023-09-19 09:47:59 +00:00
LABEL maintainer="Websoft9<help@websoft9.com>"
2024-03-26 05:47:18 +00:00
LABEL version="2.11.1"
2023-09-19 09:47:59 +00:00
2023-10-25 07:33:30 +00:00
RUN apt-get update && apt-get install --no-install-recommends -y curl jq && rm -rf /var/lib/apt/lists/*
COPY ./config/initproxy.conf /etc/
COPY ./s6/w9init/setuser.sh /app/setuser.sh
COPY ./s6/w9init/migration.sh /app/migration.sh
2023-12-11 02:44:09 +00:00
COPY ./s6/w9init/setproxy.sh /app/setproxy.sh
2023-12-11 02:53:49 +00:00
RUN chmod +x /app/setuser.sh /app/migration.sh /app/setproxy.sh
2023-10-12 05:47:38 +00:00
2023-11-01 01:04:50 +00:00
RUN export add_ip_data="const ipDataFile={[CLOUDFRONT_URL]:'ip-ranges.json',[CLOUDFARE_V4_URL]:'ips-v4',[CLOUDFARE_V6_URL]:'ips-v6'}[url];logger.info(ipDataFile);if(ipDataFile){return fs.readFile(__dirname+'/../lib/ipData/'+ipDataFile,'utf8',(error,data)=>{if(error){logger.error('fetch '+ipDataFile+' error');reject(error);return}logger.info('fetch '+ipDataFile+' success');resolve(data)})}" && \
sed -i "s#url);#&${add_ip_data}#g" /app/internal/ip_ranges.js && \
mkdir -p /app/lib/ipData && cd /app/lib/ipData && \
curl -O https://ip-ranges.amazonaws.com/ip-ranges.json && \
curl -O https://www.cloudflare.com/ips-v4 && \
curl -O https://www.cloudflare.com/ips-v6
2024-01-10 07:31:30 +00:00
CMD ["/bin/sh", "-c", "/app/migration.sh && /app/setuser.sh && /app/setproxy.sh && tail -f /dev/null"]