forked from lost-pixel/lost-pixel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (25 loc) · 885 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
# Build Stage
FROM node:16-alpine as builder
WORKDIR /app
COPY src src
COPY tsconfig.json .
COPY package.json .
COPY package-lock.json .
RUN npm install --ignore-scripts
RUN npm run build
# Ensure odiff binary is present and linked correctly, --ignore-scripts ignores post-install which is needed by odiff
RUN cd node_modules/odiff-bin && npm run postinstall
# Run Stage
FROM mcr.microsoft.com/playwright:v1.25.2-focal AS runner
# Check available tags: https://mcr.microsoft.com/en-us/product/playwright/tags
ENV NODE_ENV=production
WORKDIR /lost-pixel
COPY --from=builder /app/dist dist
COPY --from=builder /app/node_modules node_modules
COPY config-templates config-templates
COPY package.json .
COPY entrypoint.sh /entrypoint.sh
RUN ln -s /lost-pixel/dist/bin.js /usr/local/bin/lost-pixel
RUN chmod +x /usr/local/bin/lost-pixel
WORKDIR /
ENTRYPOINT ["/entrypoint.sh"]