|
|
@ -12,12 +12,13 @@ RUN cp $GOPATH/bin/litestream /usr/src/lt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM node:12 as builder |
|
|
|
FROM node:18.12.1-alpine as builder |
|
|
|
WORKDIR /usr/src/app |
|
|
|
WORKDIR /usr/src/app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# install pnpm |
|
|
|
|
|
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate |
|
|
|
|
|
|
|
|
|
|
|
# Copy application dependency manifests to the container image. |
|
|
|
# Copy application dependency manifests to the container image. |
|
|
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied. |
|
|
|
|
|
|
|
# Copying this separately prevents re-running pnpm install on every code change. |
|
|
|
|
|
|
|
COPY ./package*.json ./ |
|
|
|
COPY ./package*.json ./ |
|
|
|
COPY ./docker/main.js ./docker/main.js |
|
|
|
COPY ./docker/main.js ./docker/main.js |
|
|
|
#COPY ./docker/start.sh /usr/src/appEntry/start.sh |
|
|
|
#COPY ./docker/start.sh /usr/src/appEntry/start.sh |
|
|
@ -25,7 +26,7 @@ COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh |
|
|
|
# install production dependencies, |
|
|
|
# install production dependencies, |
|
|
|
# reduce node_module size with modclean & removing sqlite deps, |
|
|
|
# reduce node_module size with modclean & removing sqlite deps, |
|
|
|
# package built code into app.tar.gz & add execute permission to start.sh |
|
|
|
# package built code into app.tar.gz & add execute permission to start.sh |
|
|
|
RUN pnpm install --production --quiet |
|
|
|
RUN pnpm install --prod --reporter=silent |
|
|
|
RUN npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run |
|
|
|
RUN npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run |
|
|
|
RUN rm -rf ./node_modules/sqlite3/deps |
|
|
|
RUN rm -rf ./node_modules/sqlite3/deps |
|
|
|
RUN tar -czf ../appEntry/app.tar.gz ./* |
|
|
|
RUN tar -czf ../appEntry/app.tar.gz ./* |
|
|
|