2018-10-08 05:36:20 -04:00
|
|
|
# Dockerfile for git-bridge
|
|
|
|
|
2024-09-20 10:03:26 -04:00
|
|
|
FROM maven:3-amazoncorretto-21-debian AS base
|
2020-12-10 09:51:05 -05:00
|
|
|
|
2021-07-19 05:50:25 -04:00
|
|
|
RUN apt-get update && apt-get install -y make git sqlite3 \
|
|
|
|
&& rm -rf /var/lib/apt/lists
|
2020-12-10 09:51:05 -05:00
|
|
|
|
2021-05-07 04:44:29 -04:00
|
|
|
COPY vendor/envsubst /opt/envsubst
|
|
|
|
RUN chmod +x /opt/envsubst
|
|
|
|
|
2020-12-10 09:51:05 -05:00
|
|
|
RUN useradd --create-home node
|
|
|
|
|
2024-09-20 10:03:26 -04:00
|
|
|
FROM base AS builder
|
2018-10-08 05:36:20 -04:00
|
|
|
|
2021-05-07 04:44:29 -04:00
|
|
|
COPY . /app
|
|
|
|
|
2019-04-17 07:45:21 -04:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-12-10 09:51:05 -05:00
|
|
|
RUN make package \
|
2019-04-17 07:45:21 -04: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 \;
|
|
|
|
|
2024-07-04 03:53:35 -04:00
|
|
|
FROM amazoncorretto:21-alpine
|
2019-04-17 07:45:21 -04:00
|
|
|
|
2024-07-16 05:39:39 -04:00
|
|
|
RUN apk add --update --no-cache bash git sqlite procps htop net-tools jemalloc util-linux
|
2019-04-26 14:07:58 -04:00
|
|
|
|
2024-04-22 05:01:37 -04:00
|
|
|
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
2021-07-19 06:05:57 -04:00
|
|
|
|
2021-06-23 09:58:49 -04:00
|
|
|
# Install Google Cloud Profiler agent
|
2021-06-23 09:22:04 -04:00
|
|
|
RUN mkdir -p /opt/cprof && \
|
|
|
|
wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \
|
|
|
|
| tar xzv -C /opt/cprof
|
|
|
|
|
2024-04-22 05:01:37 -04:00
|
|
|
RUN adduser -D node
|
2021-07-15 11:54:38 -04:00
|
|
|
|
2021-07-19 05:50:25 -04:00
|
|
|
COPY --from=builder /git-bridge.jar /
|
2020-12-10 09:51:05 -05:00
|
|
|
|
2021-05-07 04:44:29 -04:00
|
|
|
COPY vendor/envsubst /opt/envsubst
|
|
|
|
RUN chmod +x /opt/envsubst
|
|
|
|
|
2021-04-30 10:47:07 -04:00
|
|
|
COPY conf/envsubst_template.json envsubst_template.json
|
|
|
|
COPY start.sh start.sh
|
2023-03-27 10:26:23 -04:00
|
|
|
COPY server-pro-start.sh server-pro-start.sh
|
2021-04-30 10:47:07 -04:00
|
|
|
|
|
|
|
RUN mkdir conf
|
|
|
|
RUN chown node:node conf
|
|
|
|
|
2020-12-10 09:51:05 -05:00
|
|
|
USER node
|
2021-05-07 04:44:29 -04:00
|
|
|
|
2021-05-12 07:32:14 -04:00
|
|
|
CMD ["/start.sh"]
|