diff --git a/stunnel/Dockerfile b/stunnel/Dockerfile new file mode 100644 index 0000000..59fa152 --- /dev/null +++ b/stunnel/Dockerfile @@ -0,0 +1,11 @@ +ARG UBUNTU_VERSION="noble" + +FROM ubuntu:${UBUNTU_VERSION} + +RUN apt -y update + +RUN apt -y install stunnel + +ADD stunnel.conf /etc/stunnel/stunnel.conf + +CMD stunnel diff --git a/stunnel/docker-compose.yml b/stunnel/docker-compose.yml new file mode 100644 index 0000000..5e539d9 --- /dev/null +++ b/stunnel/docker-compose.yml @@ -0,0 +1,20 @@ +services: + stunnel: + restart: on-failure:3 + build: + context: . + image: stunnel + network_mode: "host" + volumes: + - ../custom/ca.crt:/ca.crt:ro + - ../custom/server.crt:/server.crt:ro + - ../custom/server.key:/server.key:ro + - ./stunnel.conf:/etc/stunnel/stunnel.conf:ro + ulimits: + nofile: + soft: "102400" + hard: "102400" + logging: + driver: "json-file" + options: + max-size: "64k" diff --git a/stunnel/stunnel.conf b/stunnel/stunnel.conf new file mode 100644 index 0000000..597140a --- /dev/null +++ b/stunnel/stunnel.conf @@ -0,0 +1,8 @@ +foreground = yes +[certificate-based server] +accept = 0.0.0.0:7777 +connect = 127.0.0.1:6000 +cert = /server.crt +key = /server.key +#verifyPeer = yes +CAfile = /ca.crt