summary refs log tree commit diff
path: root/Dockerfile
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-02-17 02:09:26 +0100
committerMel <einebeere@gmail.com>2024-02-17 02:09:26 +0100
commitc1cab90dbcd0f1fc743cb733114064f602766db6 (patch)
treef63817122163eb7ef99b7e329279a6225f2df440 /Dockerfile
downloadsingle-container-example-c1cab90dbcd0f1fc743cb733114064f602766db6.tar.zst
single-container-example-c1cab90dbcd0f1fc743cb733114064f602766db6.zip
Single container with a service and Postgres main
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..3f3de0f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,14 @@
+FROM alpine:latest AS build
+WORKDIR /build
+RUN apk update && \
+    apk add --no-cache gcc musl-dev postgresql-dev
+
+COPY service.c .
+RUN gcc -o service service.c -lpq
+
+FROM postgres:alpine
+
+COPY script.sh .
+COPY --from=build /build/service .
+
+ENTRYPOINT ["./script.sh"]