[FEAT] update size of Image fomr 1.3GB to 186MB
This commit is contained in:
parent
7c5c0de697
commit
1067a3ea88
35
Dockerfile
35
Dockerfile
@ -17,7 +17,7 @@ RUN pacman -Syu --noconfirm && pacman-db-upgrade \
|
|||||||
&& pacman -S --noconfirm maven npm pnpm \
|
&& pacman -S --noconfirm maven npm pnpm \
|
||||||
&& pacman -Scc --noconfirm
|
&& pacman -Scc --noconfirm
|
||||||
|
|
||||||
ENV PATH /tmp/node_modules/.bin:$PATH
|
ENV PATH=/tmp/node_modules/.bin:$PATH
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
##
|
##
|
||||||
@ -80,34 +80,25 @@ RUN pnpm static:build
|
|||||||
## Production area:
|
## Production area:
|
||||||
##
|
##
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
FROM bellsoft/liberica-openjdk-alpine-musl:latest
|
||||||
|
|
||||||
#FROM bellsoft/liberica-openjdk-alpine:latest
|
RUN apk add --no-cache wget
|
||||||
## add wget to manage the health check...
|
|
||||||
#RUN apk add --no-cache wget
|
|
||||||
FROM common
|
|
||||||
|
|
||||||
#FROM archlinux:base
|
RUN addgroup -S user \
|
||||||
#RUN pacman -Syu --noconfirm && pacman-db-upgrade
|
&& adduser -S user -G user
|
||||||
## install package
|
|
||||||
#RUN pacman -S --noconfirm jdk-openjdk wget
|
|
||||||
## intall npm
|
|
||||||
#RUN pacman -S --noconfirm npm
|
|
||||||
## clean all the caches Need only on the release environment
|
|
||||||
#RUN pacman -Scc --noconfirm
|
|
||||||
|
|
||||||
ENV LANG C.UTF-8
|
|
||||||
|
|
||||||
COPY --from=build_back /tmp/out/maven/*.jar /application/application.jar
|
|
||||||
COPY --from=build_front /tmp/dist /application/front/
|
|
||||||
|
|
||||||
# COPY front/public/icons /application/front/public/icons
|
|
||||||
# COPY front/public/icons /application/front/icons
|
|
||||||
WORKDIR /application/
|
|
||||||
|
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
WORKDIR /application/
|
||||||
|
RUN chown user:user -R /application
|
||||||
|
|
||||||
# To verify health-check: docker inspect --format "{{json .State.Health }}" YOUR_SERVICE_NAME | jq
|
# To verify health-check: docker inspect --format "{{json .State.Health }}" YOUR_SERVICE_NAME | jq
|
||||||
HEALTHCHECK --start-period=10s --start-interval=2s --interval=30s --timeout=5s --retries=10 \
|
HEALTHCHECK --start-period=10s --start-interval=2s --interval=30s --timeout=5s --retries=10 \
|
||||||
CMD wget --no-verbose --tries=1 --spider http://localhost:80/api/health_check || exit 1
|
CMD wget --no-verbose --tries=1 --spider http://localhost:80/api/health_check || exit 1
|
||||||
|
|
||||||
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.atriasoft.karusic.WebLauncher"]
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.atriasoft.karusic.WebLauncher"]
|
||||||
|
|
||||||
|
COPY --chown=user:user --from=build_back /tmp/out/maven/*.jar /application/application.jar
|
||||||
|
COPY --chown=user:user --from=build_front /tmp/dist /application/front/
|
||||||
|
|
||||||
|
USER user
|
||||||
|
Loading…
x
Reference in New Issue
Block a user