Skip to content

Commit

Permalink
Fix matrix-invite build
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Jul 18, 2024
1 parent 0e6b793 commit 175cd1a
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions packages/matrix-invite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
from node:18-alpine as builder
# Base for final image
FROM debian:bookworm-slim as node-minimal

ENV PORT=5000

WORKDIR /app
RUN apt update && \
apt -y dist-upgrade && \
apt -y install nodejs && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# Temporary image to build app
FROM debian:bookworm-slim as builder

RUN apt update && \
apt -y dist-upgrade && \
apt -y install nodejs npm && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app

COPY . .
RUN ls -l /usr/src/app

RUN npm i
RUN npm run build
RUN ls -l /usr/src/app

from node:18-alpine as deploy
from node-minimal

WORKDIR /app
RUN rm -rf ./*
COPY --from=builder /app/package.json .
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /usr/src/app/package.json .
COPY --from=builder /usr/src/app/build ./build
COPY --from=builder /usr/src/app/node_modules ./node_modules

EXPOSE $PORT

Expand Down

0 comments on commit 175cd1a

Please sign in to comment.