mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
e8fe5abc82
Install bash in git-bridge Docker image GitOrigin-RevId: 2ed599c3c2a3a1c3e66845d4d17d6ac36d925d70
53 lines
1.2 KiB
Docker
53 lines
1.2 KiB
Docker
# Dockerfile for git-bridge
|
|
|
|
FROM maven:3-amazoncorretto-11-debian as base
|
|
|
|
RUN apt-get update && apt-get install -y make git sqlite3 \
|
|
&& 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
|
|
|
|
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.
|
|
&& find /app/target \
|
|
-name 'writelatex-git-bridge*jar-with-dependencies.jar' \
|
|
-exec mv {} /git-bridge.jar \;
|
|
|
|
FROM amazoncorretto:11-alpine
|
|
|
|
RUN apk add --update --no-cache bash git sqlite procps htop net-tools jemalloc
|
|
|
|
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
|
|
|
# Install Google Cloud Profiler agent
|
|
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
|
|
|
|
RUN adduser -D node
|
|
|
|
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
|
|
COPY server-pro-start.sh server-pro-start.sh
|
|
|
|
RUN mkdir conf
|
|
RUN chown node:node conf
|
|
|
|
USER node
|
|
|
|
CMD ["/start.sh"]
|