support TZ customization

This commit is contained in:
Umputun
2021-04-11 17:10:40 -05:00
parent 74505c3671
commit c53d28b12d
3 changed files with 23 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ WORKDIR /build
RUN apk add -u git
RUN \
if [ -z "$CI" ] ; then \
echo "runs outside of CI" && version=$(git log -1 --format=%h)-$(date +%Y%m%dT%H:%M:%S); \
echo "runs outside of CI" && version=$(git rev-parse --abbrev-ref HEAD)-$(git log -1 --format=%h)-$(date +%Y%m%dT%H:%M:%S); \
else version=${GIT_BRANCH}-${GITHUB_SHA:0:7}-$(date +%Y%m%dT%H:%M:%S); fi && \
echo "version=$version" && \
cd app && go build -o /build/reproxy -ldflags "-X main.revision=${version} -s -w"
@@ -23,17 +23,20 @@ FROM alpine:3.13
ENV \
TERM=xterm-color \
TIME_ZONE=America/Chicago
TIME_ZONE=UTC
RUN \
apk add --no-cache --update tzdata curl ca-certificates && \
apk add --no-cache --update tzdata curl ca-certificates dumb-init && \
cp /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime && \
echo "${TIME_ZONE}" > /etc/timezone && date && \
ln -s /usr/bin/dumb-init /sbin/dinit && \
rm -rf /var/cache/apk/*
COPY init.sh /init.sh
COPY --from=backend /build/reproxy /srv/reproxy
RUN chmod +x /srv/reproxy
LABEL reproxy.enabled="false"
WORKDIR /srv
ENTRYPOINT ["/srv/reproxy"]
ENTRYPOINT ["/init.sh"]
CMD ["/srv/reproxy"]