-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.xvfb
50 lines (34 loc) · 1.08 KB
/
Dockerfile.xvfb
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
FROM rust:alpine3.21 AS rustbuilder
WORKDIR /app
RUN apk upgrade --update-cache --available && \
apk add gcc cmake make g++ musl-dev
COPY . .
RUN cargo install --no-default-features --path .
FROM alpine:3.21
# Installs latest Chromium package.
RUN apk upgrade --no-cache --available \
&& apk add --no-cache \
chromium-swiftshader \
ttf-freefont \
font-noto-emoji \
&& apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
font-wqy-zenhei
COPY local.conf /etc/fonts/local.conf
# Add Chrome as a user
RUN mkdir -p /usr/src/app \
&& adduser -D chrome \
&& chown -R chrome:chrome /usr/src/app
EXPOSE 9222 6000
USER root
COPY --from=rustbuilder /usr/local/cargo/bin/chrome_server /usr/local/bin/chrome_server
COPY ./docker-entrypoint-xvfb.sh /
RUN apk add --no-cache tini curl sudo xvfb dbus
RUN chmod +x /docker-entrypoint-xvfb.sh
USER chrome
ENV DISPLAY=:0
ENV REMOTE_ADDRESS=0.0.0.0
ENV LAUNCH=init
ENV DEFAULT_PORT=9224
ENV DEFAULT_PORT_SERVER=6001
ENTRYPOINT ["tini", "--", "/docker-entrypoint-xvfb.sh"]