Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Dockerfile for git-bridge
  2. FROM maven:3-amazoncorretto-21-debian AS base
  3. RUN apt-get update && apt-get install -y make git sqlite3 \
  4. && rm -rf /var/lib/apt/lists
  5. COPY vendor/envsubst /opt/envsubst
  6. RUN chmod +x /opt/envsubst
  7. RUN useradd --create-home node
  8. FROM base AS builder
  9. COPY . /app
  10. WORKDIR /app
  11. RUN make package \
  12. # The name of the created jar contains the current version tag.
  13. # Rename it to a static path that can be used for copying.
  14. && find /app/target \
  15. -name 'writelatex-git-bridge*jar-with-dependencies.jar' \
  16. -exec mv {} /git-bridge.jar \;
  17. FROM amazoncorretto:21-alpine
  18. RUN apk add --update --no-cache bash git sqlite procps htop net-tools jemalloc util-linux
  19. ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
  20. RUN adduser -D node
  21. COPY --from=builder /git-bridge.jar /
  22. COPY vendor/envsubst /opt/envsubst
  23. RUN chmod +x /opt/envsubst
  24. COPY conf/envsubst_template.json envsubst_template.json
  25. COPY start.sh start.sh
  26. COPY server-pro-start.sh server-pro-start.sh
  27. RUN mkdir conf
  28. RUN chown node:node conf
  29. USER node
  30. CMD ["/start.sh"]