Skip to content

Commit

Permalink
include httpd server to test health check
Browse files Browse the repository at this point in the history
  • Loading branch information
brunodasilvalenga committed Feb 11, 2021
1 parent 1227abd commit 8749c2a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL maintainer="Kyle Manna <kyle@kylemanna.com>"

# Testing: pamtester
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn iptables bash easy-rsa=3.0.5-r0 openvpn-auth-pam google-authenticator pamtester && \
apk add --update openvpn iptables bash easy-rsa=3.0.5-r0 openvpn-auth-pam google-authenticator pamtester python3 && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*

Expand All @@ -32,6 +32,7 @@ VOLUME ["/etc/openvpn"]

# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
EXPOSE 1194/udp
EXPOSE 8080/tcp

CMD ["ovpn_run"]

Expand Down
10 changes: 10 additions & 0 deletions bin/http-server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import http.server
import socketserver

PORT = 8080

Handler = http.server.SimpleHTTPRequestHandler

with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
3 changes: 3 additions & 0 deletions bin/ovpn_run
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,8 @@ function loopCheckUpdateConfig {

loopCheckUpdateConfig &

echo "Running http server"
exec python3 http-server.py &

echo "Running 'openvpn ${ARGS[@]} ${USER_ARGS[@]}'"
exec openvpn ${ARGS[@]} ${USER_ARGS[@]}

0 comments on commit 8749c2a

Please sign in to comment.