split the base images in order to prevent recompile the base part

This commit is contained in:
LouisLam
2021-10-01 17:28:00 +08:00
parent 6513c3e75f
commit 7b4c70860c
6 changed files with 25 additions and 20 deletions

View File

@@ -1,5 +1,4 @@
# DON'T UPDATE TO alpine3.13, 1.14, see #41.
FROM node:14-alpine3.12 AS build
FROM louislam/uptime-kuma:base-alpine AS build
WORKDIR /app
COPY . .
@@ -9,14 +8,9 @@ RUN npm install --legacy-peer-deps && \
chmod +x /app/extra/entrypoint.sh
FROM node:14-alpine3.12 AS release
FROM louislam/uptime-kuma:base-alpine AS release
WORKDIR /app
# Install apprise, iputils for non-root ping, setpriv
RUN apk add --no-cache iputils setpriv dumb-init python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \
pip3 --no-cache-dir install apprise && \
rm -rf /root/.cache
# Copy app files from build layer
COPY --from=build /app /app