fix(backend): entrypoint logs to stdout

This commit is contained in:
ShiKhu 2021-07-21 20:00:27 +08:00
parent f81d24c35f
commit 5009274c40
2 changed files with 6 additions and 5 deletions

View file

@ -12,6 +12,7 @@ RUN go mod download
RUN for name in alerts assets db ender http integrations sink storage;do CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o bin/$name -tags musl openreplay/backend/services/$name; done RUN for name in alerts assets db ender http integrations sink storage;do CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o bin/$name -tags musl openreplay/backend/services/$name; done
FROM alpine FROM alpine
#FROM pygmy/alpine-tini:latest
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates
ENV TZ=UTC \ ENV TZ=UTC \
@ -50,8 +51,8 @@ COPY --from=build /root/bin /root/bin
ENV TINI_VERSION v0.19.0 ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD ./entrypoint.sh ENTRYPOINT ["/tini", "--", "./entrypoint.sh"]
#CMD ./entrypoint.sh
# CMD for name in alerts assets db ender http integrations sink storage;do nohup bin/$name &> /tmp/${name}.log ; done

View file

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/sh
for name in alerts assets db ender http integrations sink storage;do nohup bin/$name &> /tmp/${name}.log ; done for name in alerts assets db ender http integrations sink storage;do nohup bin/$name | awk -v log_from="[$name]: " '{print log_from, $0}' ; done