2018-10-08 09:36:20 +00:00
|
|
|
# Dockerfile for git-bridge
|
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
FROM maven:3-jdk-8 as base
|
|
|
|
|
2021-05-07 08:44:29 +00:00
|
|
|
RUN apt-get update && apt-get install -y make git \
|
2020-12-10 14:51:05 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists
|
|
|
|
|
2021-05-07 08:44:29 +00:00
|
|
|
COPY vendor/envsubst /opt/envsubst
|
|
|
|
RUN chmod +x /opt/envsubst
|
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
RUN useradd --create-home node
|
|
|
|
|
|
|
|
FROM base as builder
|
2018-10-08 09:36:20 +00:00
|
|
|
|
2021-05-07 08:44:29 +00:00
|
|
|
COPY . /app
|
|
|
|
|
2019-04-17 11:45:21 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
RUN make package \
|
2019-04-17 11:45:21 +00:00
|
|
|
# The name of the created jar contains the current version tag.
|
|
|
|
# Rename it to a static path that can be used for copying.
|
|
|
|
&& find /app/target \
|
|
|
|
-name 'writelatex-git-bridge*jar-with-dependencies.jar' \
|
|
|
|
-exec mv {} /git-bridge.jar \;
|
|
|
|
|
|
|
|
FROM openjdk:8-jre
|
|
|
|
|
2021-06-16 08:46:53 +00:00
|
|
|
RUN apt-get update && apt-get install -y git sqlite3 \
|
2020-12-10 14:51:05 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists
|
2019-04-26 18:07:58 +00:00
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
RUN useradd --create-home node
|
2019-04-17 11:45:21 +00:00
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
COPY --from=builder /git-bridge.jar /
|
|
|
|
|
2021-05-07 08:44:29 +00:00
|
|
|
COPY vendor/envsubst /opt/envsubst
|
|
|
|
RUN chmod +x /opt/envsubst
|
|
|
|
|
2021-04-30 14:47:07 +00:00
|
|
|
COPY conf/envsubst_template.json envsubst_template.json
|
|
|
|
COPY start.sh start.sh
|
|
|
|
|
|
|
|
RUN mkdir conf
|
|
|
|
RUN chown node:node conf
|
|
|
|
|
2020-12-10 14:51:05 +00:00
|
|
|
USER node
|
2021-05-07 08:44:29 +00:00
|
|
|
|
2021-05-12 11:32:14 +00:00
|
|
|
CMD ["/start.sh"]
|