commit 6a2e43545d694a4e45ebe4d3ab760bf331b85005 Author: Luca Date: Mon Jan 23 20:16:10 2023 +0100 Initial commit 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\""]