summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/docker-compose.yaml15
-rw-r--r--docker/postgres/Dockerfile5
-rw-r--r--docker/postgres/schema.sql99
3 files changed, 119 insertions, 0 deletions
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 23a543b..ccd957d 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -34,7 +34,22 @@ services:
source: couchdb-data
target: /opt/couchdb/data
+ postgres:
+ build: ./postgres
+ volumes:
+ - type: volume
+ source: postgres-data
+ target: /var/lib/postgresql/data/
+ environment:
+ - POSTGRES_USER
+ - POSTGRES_PASSWORD
+ - POSTGRES_DB
+ ports:
+ - 5432:5432
+
volumes:
couchdb-data:
external: false
+ postgres-data:
+ external: false
certs:
diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile
new file mode 100644
index 0000000..1699f02
--- /dev/null
+++ b/docker/postgres/Dockerfile
@@ -0,0 +1,5 @@
+FROM postgres:14
+
+COPY schema.sql /docker-entrypoint-initdb.d/
+
+EXPOSE 5432
diff --git a/docker/postgres/schema.sql b/docker/postgres/schema.sql
new file mode 100644
index 0000000..c6e1323
--- /dev/null
+++ b/docker/postgres/schema.sql
@@ -0,0 +1,99 @@
+--
+-- PostgreSQL database dump
+--
+
+-- Dumped from database version 14.2 (Debian 14.2-1.pgdg110+1)
+-- Dumped by pg_dump version 14.2 (Debian 14.2-1.pgdg110+1)
+
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
+SET check_function_bodies = false;
+SET xmloption = content;
+SET client_min_messages = warning;
+SET row_security = off;
+
+SET default_tablespace = '';
+
+SET default_table_access_method = heap;
+
+--
+-- Name: log; Type: TABLE; Schema: public; Owner: test
+--
+
+CREATE TABLE public.log (
+ id SERIAL PRIMARY KEY,
+ "timestamp" date NOT NULL,
+ username text NOT NULL,
+ logtext text
+);
+
+
+ALTER TABLE public.log OWNER TO test;
+
+--
+-- Name: scanner; Type: TABLE; Schema: public; Owner: test
+--
+
+CREATE TABLE public.scanner (
+ id SERIAL PRIMARY KEY,
+ runner text DEFAULT '*',
+ name character varying(128) NOT NULL,
+ active boolean NOT NULL,
+ "interval" integer DEFAULT 300 NOT NULL,
+ starttime date,
+ endtime date,
+ maxruns integer DEFAULT 1,
+ hostname character varying(128) NOT NULL,
+ port integer NOT NULL
+);
+
+
+ALTER TABLE public.scanner OWNER TO test;
+
+--
+-- Data for Name: log; Type: TABLE DATA; Schema: public; Owner: test
+--
+
+COPY public.log (id, "timestamp", username, logtext) FROM stdin;
+\.
+
+
+--
+-- Data for Name: scanner; Type: TABLE DATA; Schema: public; Owner: test
+--
+
+COPY public.scanner (id, name, active, "interval", starttime, endtime, maxruns) FROM stdin;
+\.
+
+
+--
+-- Name: log log_pkey; Type: CONSTRAINT; Schema: public; Owner: test
+--
+
+ALTER TABLE ONLY public.log
+ ADD CONSTRAINT log_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: scanner scanner_name_key; Type: CONSTRAINT; Schema: public; Owner: test
+--
+
+ALTER TABLE ONLY public.scanner
+ ADD CONSTRAINT scanner_name_key UNIQUE (name);
+
+
+--
+-- Name: scanner scanner_pkey; Type: CONSTRAINT; Schema: public; Owner: test
+--
+
+ALTER TABLE ONLY public.scanner
+ ADD CONSTRAINT scanner_pkey PRIMARY KEY (id);
+
+
+--
+-- PostgreSQL database dump complete
+--