summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2022-12-15 08:15:55 +0000
committergrunfink <grunfink@noreply.codeberg.org>2022-12-15 08:15:55 +0000
commitd2febc41d33cf0eae5c61401235d358a8e6a13fe (patch)
treee58795ab32ccf5f6f904b8a305ec36560ba9a08f /Dockerfile
parent953d109f10d7ae837e1dbd8769ac2dda94b45140 (diff)
parent89f6924ae2493b5670bbd24a2db1bde69a3118a6 (diff)
Merge pull request 'Improve Docker image generation' (#24) from ogarcia/snac2:docker into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/24
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile26
1 files changed, 15 insertions, 11 deletions
diff --git a/Dockerfile b/Dockerfile
index 05ae1fe..e909cfa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,16 @@
-FROM alpine
-ENV LANG C.UTF-8
-ENV LC_ALL C.UTF-8
-RUN apk add --no-cache curl-dev build-base
+ARG ALPINE_VERSION=latest
+
+FROM alpine:${ALPINE_VERSION} AS builder
COPY . /build
-WORKDIR /build
-RUN make
-COPY examples/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
-RUN chmod +x /usr/local/bin/entrypoint.sh
-ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]
-EXPOSE 8001
-CMD /build/snac
+RUN apk -U --no-progress --no-cache add curl-dev build-base && \
+ cd /build && make && \
+ make PREFIX="/build/out/usr/local" PREFIX_MAN="/build/out/usr/local/share/man" install && \
+ chmod +x examples/docker-entrypoint.sh && \
+ cp examples/docker-entrypoint.sh /build/out/usr/local/bin/entrypoint.sh
+
+FROM alpine:${ALPINE_VERSION}
+RUN apk -U --no-progress --no-cache add libcurl
+COPY --from=builder /build/out /
+EXPOSE 5050
+VOLUME [ "/data" ]
+ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]