-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
27 lines (20 loc) · 835 Bytes
/
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
FROM node:14-alpine as reactBuild
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY /react/package.json /app/package.json
RUN npm install
RUN npm install axios
COPY ./react /app
RUN npm run build
FROM maven:3.8-jdk-11 AS springBootBuild
ADD ./app ./app
COPY --from=reactbuild /app/build /app/src/main/resources/static
WORKDIR /app
RUN mvn -T 2C clean install -Dtest=!ImageManagerTest#GIVEN_ValidImage_WHEN_uploadAndInsertImage_THEN_returnImage+
FROM openjdk:11
COPY --from=springBootBuild /app/target/UBMarketplace.jar ./UBMarketplace.jar
#For local test only
#ENV PORT=8080
#ENV MONGODB_URL="mongodb://username:password@123.123.123.123:27017/"
EXPOSE $PORT
CMD java -Xmx512M -Xms400M -XX:+UseG1GC -XX:+AggressiveOpts -XX:+UseCompressedOops -jar UBMarketplace.jar --server.port=$PORT --spring.data.mongodb.uri=$MONGODB_URL