-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (25 loc) · 939 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
28
29
30
31
32
33
34
35
36
37
38
39
FROM node:latest AS storefront
LABEL maintainer="Joshua Cassidy" \
version="0.1.0"
WORKDIR /usr/src/greatapp/frontend
COPY ./src/main/frontend/package.json .
RUN npm install
COPY ./src/main/frontend/. /usr/src/greatapp/frontend
RUN ./node_modules/.bin/react-scripts build && npm run delete-source-maps
FROM maven:3.5.0-jdk-8 AS appserver
WORKDIR /usr/src/greatapp
ADD pom.xml pom.xml
ADD ./src/. /usr/src/greatapp/src/.
COPY --from=storefront /usr/src/greatapp/frontend/build /usr/src/greatapp/src/main/resources/static/
RUN mvn package -Dskip.npm
FROM java:8-jdk
ENV jdbcurl='jdbc:mysql://mysql:3306/greatapp' \
jdbcuser='user' \
jdbcpass='password' \
jdbcdialect='org.hibernate.dialect.MySQL5Dialect' \
logspath='/app/logs/application.log'
WORKDIR /app
ADD ./wait-for-it.sh .
RUN chmod +x wait-for-it.sh
COPY --from=appserver /usr/src/greatapp/target/spring-boot-and-react-app-0.1.0.jar .
EXPOSE 8080