diff options
| author | 2022-12-15 08:15:55 +0000 | |
|---|---|---|
| committer | 2022-12-15 08:15:55 +0000 | |
| commit | d2febc41d33cf0eae5c61401235d358a8e6a13fe (patch) | |
| tree | e58795ab32ccf5f6f904b8a305ec36560ba9a08f | |
| parent | Version 2.15 RELEASED. (diff) | |
| parent | Improve Docker image generation (diff) | |
| download | penes-snac2-d2febc41d33cf0eae5c61401235d358a8e6a13fe.tar.gz penes-snac2-d2febc41d33cf0eae5c61401235d358a8e6a13fe.tar.xz penes-snac2-d2febc41d33cf0eae5c61401235d358a8e6a13fe.zip | |
Merge pull request 'Improve Docker image generation' (#24) from ogarcia/snac2:docker into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/24
| -rw-r--r-- | Dockerfile | 26 | ||||
| -rwxr-xr-x | examples/docker-entrypoint.sh | 7 |
2 files changed, 19 insertions, 14 deletions
| @@ -1,12 +1,16 @@ | |||
| 1 | FROM alpine | 1 | ARG ALPINE_VERSION=latest |
| 2 | ENV LANG C.UTF-8 | 2 | |
| 3 | ENV LC_ALL C.UTF-8 | 3 | FROM alpine:${ALPINE_VERSION} AS builder |
| 4 | RUN apk add --no-cache curl-dev build-base | ||
| 5 | COPY . /build | 4 | COPY . /build |
| 6 | WORKDIR /build | 5 | RUN apk -U --no-progress --no-cache add curl-dev build-base && \ |
| 7 | RUN make | 6 | cd /build && make && \ |
| 8 | COPY examples/docker-entrypoint.sh /usr/local/bin/entrypoint.sh | 7 | make PREFIX="/build/out/usr/local" PREFIX_MAN="/build/out/usr/local/share/man" install && \ |
| 9 | RUN chmod +x /usr/local/bin/entrypoint.sh | 8 | chmod +x examples/docker-entrypoint.sh && \ |
| 10 | ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"] | 9 | cp examples/docker-entrypoint.sh /build/out/usr/local/bin/entrypoint.sh |
| 11 | EXPOSE 8001 | 10 | |
| 12 | CMD /build/snac | 11 | FROM alpine:${ALPINE_VERSION} |
| 12 | RUN apk -U --no-progress --no-cache add libcurl | ||
| 13 | COPY --from=builder /build/out / | ||
| 14 | EXPOSE 5050 | ||
| 15 | VOLUME [ "/data" ] | ||
| 16 | ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
diff --git a/examples/docker-entrypoint.sh b/examples/docker-entrypoint.sh index b64e039..639b692 100755 --- a/examples/docker-entrypoint.sh +++ b/examples/docker-entrypoint.sh | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #! /bin/sh | ||
| 1 | if [ ! -e /data/data/server.json ] | 2 | if [ ! -e /data/data/server.json ] |
| 2 | then | 3 | then |
| 3 | echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n" | /build/snac init /data/data | 4 | echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n" | snac init /data/data |
| 4 | /build/snac adduser /data/data testuser | 5 | snac adduser /data/data testuser |
| 5 | fi | 6 | fi |
| 6 | SSLKEYLOGFILE=/data/key /build/snac httpd /data/data | 7 | SSLKEYLOGFILE=/data/key snac httpd /data/data |