Skip to content

Commit

Permalink
Reduce docker image from 1.39 GB to 611 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Jan 23, 2024
1 parent 164a125 commit 9560366
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tdrive/docker/tdrive-nextcloud-migration/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Use an official Node.js runtime as the base image
FROM node:bullseye
FROM node:bullseye-slim AS updated

RUN apt update && apt -y dist-upgrade
RUN apt install dirmngr
RUN apt install -y gnupg

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
Expand All @@ -13,10 +13,12 @@ RUN apt update -y

RUN apt install --assume-yes nextcloud-desktop-cmd

RUN apt install ldap-utils
RUN apt install -y ldap-utils

RUN apt autoremove && apt clean && rm -rf /var/lib/apt/lists/*

FROM updated

# Set the working directory inside the container
WORKDIR /usr/src/app

Expand All @@ -32,4 +34,10 @@ RUN npm i && npm run build && npm cache clean --force && rm -rf node_modules
RUN perl -i -ne 'print unless/prestart/' package.json

# Run the Node.js application
CMD ["npm", "run", "start"]
#CMD ["npm", "run", "start"]

FROM updated

COPY --from=1 /usr/src/app/dist/* /

CMD ["node","express_server.js"]

0 comments on commit 9560366

Please sign in to comment.