简体   繁体   中英

How can i add libreoffice to Dockerfile

I have a dockerized nodejs application. I use libreoffice for converting to PDF.

How can I add libreoffice to dockerfile with nodejs app? And how can I make the app be able to use the libreoffice app?

FROM node:16.8.0-alpine

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*

RUN npm install

# If you are building your code for production
#RUN npm ci --only=production

# Bundle app source
COPY . .

RUN npm run build

EXPOSE 80:80

CMD [ "node", "build/index.js","STAGING"]

Adding the following to your Dockerfile should install libreoffice

RUN apk add libreoffice

https://pkgs.alpinelinux.org/package/edge/community/x86/libreoffice

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM