forked from spider-rs/headless-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.playwright
49 lines (30 loc) · 1.07 KB
/
Dockerfile.playwright
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
FROM rust:alpine3.19 AS rustbuilder
WORKDIR /app
RUN apk upgrade --update-cache --available && \
apk add gcc cmake make g++
COPY . .
RUN cargo install --no-default-features --path .
FROM zenika/alpine-chrome AS playwrightbuilder
EXPOSE 9222 6000
USER root
RUN apk add --no-cache tini curl sudo nodejs npm yarn \
&& npm install -g playwright \
&& npx playwright install chromium
# FROM zenika/alpine-chrome
# EXPOSE 9222 6000
# USER root
# RUN apk add --no-cache tini curl sudo nodejs npm yarn \
# && npm install -g playwright \
# && npx playwright install chromium
COPY --from=rustbuilder /usr/local/cargo/bin/chrome_server /usr/local/bin/chrome_server
RUN PLAYWRIGHT_CHROMIUM_PATH=$(find /root/.cache/ms-playwright | grep "chrome-linux/chrome$") && \
cp $PLAYWRIGHT_CHROMIUM_PATH /chromium_path
COPY ./docker-entrypoint.sh /
RUN apk add --no-cache tini curl sudo
RUN chmod +x /docker-entrypoint.sh
USER chrome
ENV REMOTE_ADDRESS=0.0.0.0
ENV LAUNCH=init
ENV DEFAULT_PORT=9222
ENV DEFAULT_PORT_SERVER=6000
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]