-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
51 lines (33 loc) · 836 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use the official Node.js image (Alpine-based)
FROM node:20-alpine as development
# Install git and dependencies for Playwright
RUN apk update && apk add --no-cache \
git \
udev \
nss \
freetype \
ttf-freefont \
harfbuzz \
libx11 \
xvfb-run
WORKDIR /app
COPY package*.json ./
# Install development dependencies
RUN npm install
COPY . .
# Build the application
RUN npm run build
# build the client
RUN cd ./client && npm install && npm run build
# Production stage
FROM mcr.microsoft.com/playwright:v1.48.1-focal as production
ENV PORT=80
WORKDIR /app
COPY package*.json ./
# Install production dependencies
RUN npm install --omit=dev
COPY --from=development /app/dist ./api
COPY --from=development ./app/client/dist ./client/dist
WORKDIR /app/api
EXPOSE $PORT
CMD ["node", "index.js"]