mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 11:40:27 +03:00
Improve Docker image generation
This commit is contained in:
parent
953d109f10
commit
89f6924ae2
26
Dockerfile
26
Dockerfile
@ -1,12 +1,16 @@
|
|||||||
FROM alpine
|
ARG ALPINE_VERSION=latest
|
||||||
ENV LANG C.UTF-8
|
|
||||||
ENV LC_ALL C.UTF-8
|
FROM alpine:${ALPINE_VERSION} AS builder
|
||||||
RUN apk add --no-cache curl-dev build-base
|
|
||||||
COPY . /build
|
COPY . /build
|
||||||
WORKDIR /build
|
RUN apk -U --no-progress --no-cache add curl-dev build-base && \
|
||||||
RUN make
|
cd /build && make && \
|
||||||
COPY examples/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
|
make PREFIX="/build/out/usr/local" PREFIX_MAN="/build/out/usr/local/share/man" install && \
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
chmod +x examples/docker-entrypoint.sh && \
|
||||||
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]
|
cp examples/docker-entrypoint.sh /build/out/usr/local/bin/entrypoint.sh
|
||||||
EXPOSE 8001
|
|
||||||
CMD /build/snac
|
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" ]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
#! /bin/sh
|
||||||
if [ ! -e /data/data/server.json ]
|
if [ ! -e /data/data/server.json ]
|
||||||
then
|
then
|
||||||
echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n" | /build/snac init /data/data
|
echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n" | snac init /data/data
|
||||||
/build/snac adduser /data/data testuser
|
snac adduser /data/data testuser
|
||||||
fi
|
fi
|
||||||
SSLKEYLOGFILE=/data/key /build/snac httpd /data/data
|
SSLKEYLOGFILE=/data/key snac httpd /data/data
|
||||||
|
Loading…
Reference in New Issue
Block a user