|
@ -1,17 +1,20 @@ |
|
|
# There's an issue with node:20-alpine. |
|
|
# As a workaround we have to build on nodejs 18 |
|
|
# Docker deployment is canceled after 25< minutes. |
|
|
# nodejs 20 hangs on build with armv6/armv7 |
|
|
|
|
|
|
|
|
FROM docker.io/library/node:18-alpine AS build_node_modules |
|
|
FROM docker.io/library/node:18-alpine AS build_node_modules |
|
|
|
|
|
|
|
|
# Copy Web UI |
|
|
# Copy Web UI |
|
|
COPY src/ /app/ |
|
|
COPY src/ /app/ |
|
|
WORKDIR /app |
|
|
WORKDIR /app |
|
|
RUN npm ci --omit=dev &&\ |
|
|
RUN npm ci --omit=dev &&\ |
|
|
|
|
|
# Enable this to run `npm run serve` |
|
|
|
|
|
npm i -g nodemon &&\ |
|
|
|
|
|
# Delete unnecessary files |
|
|
|
|
|
npm cache clean --force && rm -rf ~/.npm &&\ |
|
|
mv node_modules /node_modules |
|
|
mv node_modules /node_modules |
|
|
|
|
|
|
|
|
# Copy build result to a new image. |
|
|
# Copy build result to a new image. |
|
|
# This saves a lot of disk space. |
|
|
# This saves a lot of disk space. |
|
|
FROM docker.io/library/node:18-alpine |
|
|
FROM docker.io/library/node:20-alpine |
|
|
COPY --from=build_node_modules /app /app |
|
|
COPY --from=build_node_modules /app /app |
|
|
|
|
|
|
|
|
# Move node_modules one directory up, so during development |
|
|
# Move node_modules one directory up, so during development |
|
@ -23,12 +26,6 @@ COPY --from=build_node_modules /app /app |
|
|
# than what runs inside of docker. |
|
|
# than what runs inside of docker. |
|
|
COPY --from=build_node_modules /node_modules /node_modules |
|
|
COPY --from=build_node_modules /node_modules /node_modules |
|
|
|
|
|
|
|
|
RUN \ |
|
|
|
|
|
# Enable this to run `npm run serve` |
|
|
|
|
|
npm i -g nodemon &&\ |
|
|
|
|
|
# Delete unnecessary files |
|
|
|
|
|
npm cache clean --force && rm -rf ~/.npm |
|
|
|
|
|
|
|
|
|
|
|
# Install Linux packages |
|
|
# Install Linux packages |
|
|
RUN apk add --no-cache \ |
|
|
RUN apk add --no-cache \ |
|
|
dpkg \ |
|
|
dpkg \ |
|
|