Nextcloud migration:: add security tips + reduce size (#307)
* Add security tips * Don't rebuild on start * Build a full bundle with rollup, then minimize image size
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
# Use an official Node.js runtime as the base image
|
||||
FROM node:bullseye
|
||||
|
||||
run apt update && apt -y dist-upgrade
|
||||
RUN apt install dirmngr
|
||||
|
||||
RUN echo "deb http://ppa.launchpad.net/nextcloud-devs/client/ubuntu zesty main" >> /etc/apt/sources.list.d/nextcloud-client.list
|
||||
RUN echo "deb-src http://ppa.launchpad.net/nextcloud-devs/client/ubuntu zesty main" >> /etc/apt/sources.list.d/nextcloud-client.list
|
||||
|
||||
RUN apt install dirmngr
|
||||
RUN apt-key adv --recv-key --keyserver keyserver.ubuntu.com AD3DD469
|
||||
|
||||
RUN apt update
|
||||
@@ -13,6 +15,8 @@ RUN apt install --assume-yes nextcloud-desktop-cmd
|
||||
|
||||
RUN apt install ldap-utils
|
||||
|
||||
RUN apt autoremove && apt clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -20,8 +24,12 @@ WORKDIR /usr/src/app
|
||||
COPY backend/utils/nextcloud-migration/src/** ./src/
|
||||
COPY backend/utils/nextcloud-migration/.nvmrc ./
|
||||
COPY backend/utils/nextcloud-migration/*.json ./
|
||||
COPY backend/utils/nextcloud-migration/rollup.config.js ./
|
||||
|
||||
RUN npm i && npm run build
|
||||
RUN npm i && npm run build && npm cache clean --force && rm -rf node_modules
|
||||
|
||||
# Don't rebuild on start
|
||||
RUN perl -i -ne 'print unless/prestart/' package.json
|
||||
|
||||
# Run the Node.js application
|
||||
CMD ["npm", "run", "start"]
|
||||
|
||||
Reference in New Issue
Block a user