-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
47 lines (35 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:23@sha256:a2fea8b0b74b6e828caa6d83f4b2a0dcb2eb1ff90f30205c32f7bd36ddf976c4 AS frontend
WORKDIR /frontend
COPY frontend .
RUN npm ci
RUN npm run build
# Base image for building lpvs lib
FROM openjdk:17-slim@sha256:aaa3b3cb27e3e520b8f116863d0580c438ed55ecfa0bc126b41f68c3f62f9774 AS builder
# Install dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y maven
# Copy source code into container
WORKDIR /root/
COPY . .
# Build LPVS-open-source application
RUN mvn clean install
# Base image for running lpvs container
FROM openjdk:17-slim@sha256:aaa3b3cb27e3e520b8f116863d0580c438ed55ecfa0bc126b41f68c3f62f9774
# Install dependencies and remove tmp files
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3-pip && \
apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /root/
# Install SCANOSS
COPY --from=builder /root/requirements.txt ./
RUN pip3 install --require-hashes -r requirements.txt
# Allow to listen port 7896
EXPOSE 7896
# Set workdir for running jar
COPY --from=frontend /frontend/build/ ./static/
COPY --from=builder /root/target/lpvs-*.jar ./lpvs.jar
# Run application in container
CMD ["java", "-jar", "lpvs.jar"]