mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user