feat: dockerize, fix sign in loop
This commit is contained in:
parent
3b3289dddf
commit
a8c578bd93
6 changed files with 127 additions and 13 deletions
75
Dockerfile
Normal file
75
Dockerfile
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# FROM mcr.microsoft.com/playwright:v1.20.0
|
||||
FROM ubuntu:focal
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Configure Xvfb via environment variables:
|
||||
ENV SCREEN_WIDTH 1440
|
||||
ENV SCREEN_HEIGHT 900
|
||||
ENV SCREEN_DEPTH 24
|
||||
ENV DISPLAY :60
|
||||
|
||||
# Configure VNC via environment variables:
|
||||
ENV VNC_ENABLED true
|
||||
ENV VNC_PASSWORD secret
|
||||
ENV VNC_PORT 5900
|
||||
EXPOSE 5900
|
||||
|
||||
# === INSTALL Node.js ===
|
||||
|
||||
# Taken from https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal
|
||||
RUN apt-get update && \
|
||||
# Install node16
|
||||
apt-get install -y curl wget && \
|
||||
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
# Feature-parity with node.js base images.
|
||||
apt-get install -y --no-install-recommends git openssh-client && \
|
||||
npm install -g yarn && \
|
||||
# clean apt cache
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
# Create the pwuser
|
||||
adduser pwuser
|
||||
|
||||
|
||||
# === Install the base requirements to run and debug webdriver implementations ===
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
xvfb \
|
||||
xauth \
|
||||
ca-certificates \
|
||||
x11vnc \
|
||||
fluxbox \
|
||||
stterm \
|
||||
curl \
|
||||
tini \
|
||||
&& apt-get clean \
|
||||
&& rm -rf \
|
||||
/tmp/* \
|
||||
/usr/share/doc/* \
|
||||
/var/cache/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
|
||||
WORKDIR /fgc
|
||||
COPY package.json .
|
||||
# Install chromium & dependencies only
|
||||
RUN export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||
&& npm install \
|
||||
&& npx playwright install-deps \
|
||||
&& npx playwright install chromium \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . .
|
||||
|
||||
# Shell scripts
|
||||
RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \
|
||||
&& chmod +x /usr/local/bin/entrypoint \
|
||||
&& mv ./docker/vnc-start.sh /usr/local/bin/vnc-start \
|
||||
&& chmod +x /usr/local/bin/vnc-start
|
||||
|
||||
|
||||
ENTRYPOINT ["entrypoint"]
|
||||
CMD ["node", "epic-games.js"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue