-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (30 loc) · 896 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
FROM ghcr.io/jamiely/playwright:0.11.1 AS builder
RUN mkdir -p /build
WORKDIR /build
COPY src/*.ts src/*.js src/
COPY *.json .eslint* ./
ENV NODE_ENV=development
RUN npm install
RUN npm run build-ts
RUN ls -al dist
RUN ls -al .
FROM ghcr.io/jamiely/playwright:0.11.1
# First, setup Playwright dependencies
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
&& mkdir -p /home/pwuser \
&& chown -R pwuser:pwuser /home/pwuser
USER pwuser
WORKDIR /home/pwuser
ENV NODE_ENV=production
ENV PORT=3000
COPY package*.json ./
COPY public public
COPY --from=builder --chown=pwuser /build/dist dist
# this relies on us
COPY --from=builder --chown=pwuser /build/node_modules node_modules
RUN npm install
# Now setup API dependencies
EXPOSE 3000/tcp
# We use serve-forever because we want the script to continue to run
# if it crashes.
CMD ["npm", "run", "serve-forever"]