From: Benjamin DeLong Date: Fri, 4 Jan 2019 21:30:09 +0000 (-0400) Subject: dockerfile and env example X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f5178c751846363406922d23fab8f57a38ac1bc;p=postgresql-autodoc dockerfile and env example --- diff --git a/.gitignore b/.gitignore index 1075296..0769c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ postgresql_autodoc config.status config.mk config.log +env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d07a1a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# USAGE: +# docker build . -t autodoc +# docker run --mount src=`pwd`,target=/app,type=bind --network=host --env-file ./env -v $pwd:/app autodoc + +FROM ubuntu:18.04 + +WORKDIR /app + +RUN apt-get update + +RUN apt-get install -y libdbi-perl \ + libhtml-template-perl libterm-readkey-perl \ + libdbd-pg-perl make + +COPY . . + +RUN make install + +ENV DATABASE=app \ + HOST=localhost \ + USER=app \ + PASSWORD=password + +CMD postgresql_autodoc -d ${DATABASE} \ + -h ${HOST} \ + -u ${USER} \ + --password=${PASSWORD} \ No newline at end of file diff --git a/env-example b/env-example new file mode 100644 index 0000000..c55e4b1 --- /dev/null +++ b/env-example @@ -0,0 +1,5 @@ +# Copy, rename to env, and fill in your db details +DATABASE=app +HOST=localhost +USER=app +PASSWORD=password \ No newline at end of file