[misc] integrate git-bridge with overleaf dev-env and prod setup

- Add `base` target for dev-env
- Add `node` user for dev-env and prod
- Use `make` all the way
This commit is contained in:
Jakob Ackermann 2020-12-10 14:51:05 +00:00
parent 3e7cf07c8e
commit 4644faf212
2 changed files with 16 additions and 9 deletions

View file

@ -2,4 +2,5 @@
!/lib
!/src/main
!/pom.xml
!/Makefile
!/LICENSE

View file

@ -1,11 +1,18 @@
# Dockerfile for git-bridge
FROM maven:3-jdk-8
FROM maven:3-jdk-8 as base
RUN apt-get update && apt-get install -y make \
&& rm -rf /var/lib/apt/lists
RUN useradd --create-home node
FROM base as builder
WORKDIR /app
COPY . /app
RUN mvn clean package \
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 \
@ -14,15 +21,14 @@ RUN mvn clean package \
FROM openjdk:8-jre
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
git \
&& rm -rf \
/var/lib/apt/lists/*
RUN apt-get update && apt-get install -y git \
&& rm -rf /var/lib/apt/lists
USER www-data
RUN useradd --create-home node
ENTRYPOINT ["java", "-jar", "/git-bridge.jar"]
CMD ["/conf/runtime.json"]
COPY --from=0 /git-bridge.jar /
COPY --from=builder /git-bridge.jar /
USER node