Skip to content

Commit

Permalink
#109 Reduce docker images size
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashmerino committed Jul 13, 2024
1 parent ad975dd commit d223d5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions online-shop-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ FROM openjdk:17-jdk-slim

WORKDIR /online-shop-server

COPY --from=build /online-shop-server/target/*.jar online-shop-server-1.0-SNAPSHOT.jar
COPY --from=build /online-shop-server/target/*.jar online-shop-server.jar

EXPOSE 8081

ENTRYPOINT ["java", "-jar", "online-shop-server-1.0-SNAPSHOT.jar"]
CMD ["java", "-jar", "online-shop-server.jar"]
17 changes: 11 additions & 6 deletions online-shop-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM node:18-alpine
FROM node:18-alpine as build

WORKDIR /online-shop-ui/

RUN apk update && \
apk add --no-cache python3 make g++ && \
npm install -g node-gyp
apk add --no-cache python3 make g++

COPY package.json package-lock.json /online-shop-ui/

RUN npm install --production

COPY . /online-shop-ui/
FROM node:18-alpine

WORKDIR /online-shop-ui/

RUN npm install
COPY --from=build /online-shop-ui/ /online-shop-ui/

CMD ["npm", "start"]
CMD ["npm", "start"]

0 comments on commit d223d5f

Please sign in to comment.