revenz / Fenrus

A personal home page for quick access to all your personal apps/sites.
MIT License
545 stars 32 forks source link

Keep package install in order #21

Closed martadinata666 closed 2 years ago

martadinata666 commented 2 years ago

Add some notes, and reorder installation keep minimal

revenz commented 2 years ago

thanks big reduction in size

revenz commented 2 years ago

sadly, this actually causes a bunch of errors. it builds, looks good, but when run nothing works. The previous docker file worked. just 3x the size.,

martadinata666 commented 2 years ago

Seems there is, misconception build thing and run things, I see cairo-dev and i thought it use to compile some node modules, but it needed to run, add cairo, jpeg, pango, giflib to runtime. Do i need create another PR?

FROM alpine:3.15

# Create app directory
WORKDIR /app

# Bundle app source
COPY . .

#RUN apk add --no-cache \
#  build-base \
#  g++ \
#  cairo-dev \
#  jpeg-dev \
#  pango-dev \
#  giflib-dev

#RUN apk --no-cache add msttcorefonts-installer fontconfig && \
#    update-ms-fonts && \
#    fc-cache -f

# Add what to need for build/compose deps to build-dependencies
RUN apk -U --update --no-cache add --virtual=build-dependencies \
      npm \
      build-base \
      g++ \
      cairo-dev \
      jpeg-dev \
      pango-dev \
      giflib-dev && \
      # Runtime deps
      apk -U --update --no-cache add \
      nodejs \
      cairo \
      jpeg \
      pango \
      giflib \
      msttcorefonts-installer \
      fontconfig && \
      fc-cache -f &&\
      rm -rf ./.git && \
      npm install && \
      npm ci --only=production && \
      mkdir -p ./data && \
      # Removal build-dependencies
      apk del --purge build-dependencies

EXPOSE 3000
CMD [ "node", "app.js" ]