From 6a2e43545d694a4e45ebe4d3ab760bf331b85005 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 23 Jan 2023 20:16:10 +0100 Subject: [PATCH] Initial commit --- .dockerignore | 4 ++++ .drone.yml | 29 +++++++++++++++++++++++++++++ Dockerfile | 10 ++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .dockerignore create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3bf3671 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +.drone.yml +.git +Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e5e5f56 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,29 @@ +--- + +kind: pipeline +type: docker +name: default + +steps: + - name: build only + image: plugins/docker + settings: + dry_run: yes + repo: git.luj0ga.de/luca/postgres-tcpify + when: + event: + exclude: + - tag + + - name: build and publish + image: plugins/docker + settings: + auto_tag: yes + password: + from_secret: access_token + registry: git.luj0ga.de + repo: git.luj0ga.de/luca/postgres-tcpify + username: _ + when: + event: + - tag diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c1c58d2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3 + +ENV LISTEN_PORT=5432 +ENV SOCKET_PATH=/var/run/postgresql/.s.PGSQL.5432 + +RUN apk add --no-cache socat + +USER nobody + +CMD ["/bin/sh", "-c", "/usr/bin/socat \"tcp-listen:$LISTEN_PORT,reuseaddr,fork\" \"unix-client:$SOCKET_PATH\""]