Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
FROM node:12-alpine
FROM node:20-alpine AS builder

WORKDIR /excalidraw-room
WORKDIR /build

COPY package.json yarn.lock ./
RUN yarn
RUN yarn --frozen-lockfile

COPY tsconfig.json ./
COPY src ./src
RUN yarn build

FROM node:20-alpine AS production

WORKDIR /excalidraw-room

RUN addgroup -g 1001 -S eroom && \
adduser -S eroom -u 1001 && \
apk add --no-cache curl

COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile --prod && \
yarn cache clean

COPY --from=builder /build/dist ./dist

RUN chown -R eroom:eroom /excalidraw-room
USER eroom

EXPOSE 80

HEALTHCHECK CMD wget --no-verbose --tries=1 --spider http://localhost:80 || exit 1

CMD ["yarn", "start"]