Dockerfile 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Dockerfile for git-bridge
  2. FROM maven:3-jdk-8 as base
  3. RUN apt-get update && apt-get install -y make git \
  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 openjdk:8-jre
  18. RUN apt-get update && apt-get install -y git \
  19. && rm -rf /var/lib/apt/lists
  20. RUN useradd --create-home 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. RUN mkdir conf
  27. RUN chown node:node conf
  28. USER node
  29. ENTRYPOINT ["/start.sh"]