-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 803 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ARG BUILDER_WORKDIR=/tmp/builder/london-apartment-bot
ARG RUN_WORKDIR=/london-apartment-bot
FROM node:20-alpine as builder
ARG BUILDER_WORKDIR
WORKDIR $BUILDER_WORKDIR
COPY package*.json $BUILDER_WORKDIR
RUN npm install
COPY . $BUILDER_WORKDIR
RUN npm run build
FROM ubuntu:jammy
ENV NODE_ENV production
ENV LOG_DIR /var/log/london-apartment-bot
RUN apt-get update && apt-get install -y curl dumb-init git && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
npm install -g npm && \
rm -rf /var/lib/apt/lists/*
ARG RUN_WORKDIR
ARG BUILDER_WORKDIR
WORKDIR $RUN_WORKDIR
COPY --from=builder $BUILDER_WORKDIR $RUN_WORKDIR
RUN npx playwright install --with-deps chromium && \
npm prune --omit=dev
CMD ["dumb-init", "npm", "start"]