aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dockerignore10
-rw-r--r--Dockerfile18
-rw-r--r--Makefile2
-rw-r--r--docker-compose.yml27
-rw-r--r--src/clog.c2
5 files changed, 46 insertions, 13 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..6fe2e26
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,10 @@
+cert/
+clog.so
+.env
+.git/
+.gitignore
+.objs/
+sandbox/
+.venv/
+.vols/
+.vscode/
diff --git a/Dockerfile b/Dockerfile
index 03d0df6..c043e20 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,9 +4,10 @@ MAINTAINER Michael McVady <femtonaut@gmail.com>
RUN set -e \
&& apk add --no-cache \
- busybox-extras
+ busybox-extras \
+ libpq
-# COPY . /clog
+COPY . /clog
RUN set -e \
&& mkdir -p /var/chroot \
@@ -28,18 +29,13 @@ RUN set -e \
&& make NOTLS=1 PGSQL=1 \
&& make install \
&& cd .. \
- && rm -rf kore-4.1.0*
-
-COPY . /clog
-
-RUN set -e \
+ && rm -rf kore-4.1.0* \
&& cd /clog \
- && kodev build
-# && apk del .build-deps
+ && kodev build \
+ && apk del .build-deps
EXPOSE 8888
STOPSIGNAL SIGQUIT
WORKDIR /clog
-# ENTRYPOINT [ "kore", "-c", "conf/clog.conf", "-r", "-n", "-f"]
-ENTRYPOINT [ "kodev", "run"]
+ENTRYPOINT [ "kore", "-c", "conf/clog.conf", "-r", "-n", "-f"]
diff --git a/Makefile b/Makefile
index 3e26ce0..dbc3149 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ clean:
docker rmi -f clog:latest
docker-build:
- docker build -t clog .
+ DOCKER_BUILDKIT=1 docker build -t clog .
docker-run:
docker rm -f clog
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..e9d0ec9
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,27 @@
+version: "2"
+
+services:
+
+ clog:
+ container_name: clog
+ image: clog:latest
+ build: .
+ ports:
+ - "8888:8888"
+ environment:
+ - POSTGRES_PASSWORD=postgres
+ depends_on:
+ - postgres
+
+ postgres:
+ container_name: clog-postgres
+ image: postgres:12-alpine
+ volumes:
+ - .vols/database:/var/lib/postgresql/data
+ ports:
+ - "5555:5432"
+ environment:
+ - POSTGRES_USER=postgres
+ - POSTGRES_PASSWORD=postgres
+ - POSTGRES_DB=clog
+
diff --git a/src/clog.c b/src/clog.c
index b6c3cb1..36f0a96 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -32,7 +32,7 @@ init(int state)
// Register the database
int err = kore_pgsql_register(
database,
- "host=127.0.0.1 port=5432 user=postgres password=p0stgres dbname=clog sslmode=disable"
+ "host=postgres port=5432 user=postgres password=postgres dbname=clog sslmode=disable"
);
return err;
}