Configure from env vars at run time

In both local developent, and production.  Also, vendor the `envsubst`
binary from https://github.com/a8m/envsubst, as it supports default
values, which the gnu envsubst (from gettext-base) does not.
This commit is contained in:
Shane Kilkelly
2021-05-07 09:47:49 +01:00
parent f1c9d6108e
commit b47f21a44e
7 changed files with 49 additions and 32 deletions
+12 -5
View File
@@ -2,16 +2,20 @@
FROM maven:3-jdk-8 as base
RUN apt-get update && apt-get install -y make \
RUN apt-get update && apt-get install -y make git \
&& rm -rf /var/lib/apt/lists
COPY vendor/envsubst /opt/envsubst
RUN chmod +x /opt/envsubst
RUN useradd --create-home node
FROM base as builder
COPY . /app
WORKDIR /app
COPY . /app
RUN make package \
# The name of the created jar contains the current version tag.
# Rename it to a static path that can be used for copying.
@@ -21,15 +25,16 @@ RUN make package \
FROM openjdk:8-jre
RUN apt-get update && apt-get install -y git gettext-base\
RUN apt-get update && apt-get install -y git \
&& rm -rf /var/lib/apt/lists
RUN useradd --create-home node
CMD ["/start.sh"]
COPY --from=builder /git-bridge.jar /
COPY vendor/envsubst /opt/envsubst
RUN chmod +x /opt/envsubst
COPY conf/envsubst_template.json envsubst_template.json
COPY start.sh start.sh
@@ -37,3 +42,5 @@ RUN mkdir conf
RUN chown node:node conf
USER node
ENTRYPOINT ["/start.sh"]