ci: updated base-image

This commit is contained in:
Marvin Zhang
2024-11-20 15:04:25 +08:00
parent 76aabc3692
commit db4dce33a4
7 changed files with 66 additions and 62 deletions

View File

@@ -7,26 +7,13 @@ ENV DEBIAN_FRONTEND=noninteractive
# copy install scripts
COPY ./install /app/install
# install deps
RUN bash /app/install/deps/deps.sh
# install python
RUN bash /app/install/python/python.sh
# install golang
RUN bash /app/install/golang/golang.sh
# install node
RUN bash /app/install/node/node.sh
# install java
#RUN bash /app/install/java/java.sh
# install chromedriver
RUN bash /app/install/chromedriver/chromedriver.sh
# install rod
RUN bash /app/install/rod/rod.sh
# install all dependencies in parallel
RUN bash /app/install/deps/deps.sh & \
bash /app/install/python/python.sh & \
bash /app/install/golang/golang.sh & \
bash /app/install/node/node.sh & \
bash /app/install/chromedriver/chromedriver.sh & \
wait
# working directory
WORKDIR /app/backend

View File

@@ -4,7 +4,13 @@
version="stable"
# deps
apt-get install -y xvfb libxi6 libgconf-2-4
apt-get install -y \
xvfb \
libxi6 \
libgconf-2-4 \
libglib2.0-0 \
libnss3 \
libx11-6
# install puppeteer browsers package globally first
npm install -g @puppeteer/browsers

View File

@@ -7,7 +7,18 @@ chmod 777 /tmp
apt-get update
# common deps
apt-get install -y curl git net-tools iputils-ping ntp ntpdate nginx wget dumb-init cloc unzip build-essential gnupg2 libc6
# chromedriver deps
apt-get install -y libglib2.0-0 libnss3 libx11-6 # chromedriver deps
apt-get install -y \
curl \
git \
net-tools \
iputils-ping \
ntp \
ntpdate \
nginx \
wget \
dumb-init \
cloc \
unzip \
build-essential \
gnupg2 \
libc6

View File

@@ -1,3 +1,10 @@
#!/bin/bash
apt-get install -y openjdk-11-jdk
# Exit on error
set -e
# Update package list and install OpenJDK 11
DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jdk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

View File

@@ -19,16 +19,16 @@ nvm alias default ${version}
# verifies the right Node.js version is in the environment
if [[ ! "$(node -v)" =~ ^v${version} ]]; then
echo "Node.js version is not v${version}.x"
exit 1
echo "Node.js version is not v${version}.x"
exit 1
fi
# install node dependencies
npm install -g \
yarn \
pnpm \
crawlab-sdk@latest \
puppeteer \
playwright \
playwright-chromium \
crawlee
yarn \
pnpm \
crawlab-sdk@latest \
puppeteer \
playwright \
playwright-chromium \
crawlee

View File

@@ -2,6 +2,26 @@
version="3.12"
# install build dependencies
apt-get install -y \
make \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncursesw5-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libffi-dev \
liblzma-dev
# install pyenv
curl https://pyenv.run | bash

View File

@@ -1,27 +0,0 @@
#!/bin/bash
cat <<EOF > go.mod
module rod_github
go 1.16
require github.com/go-rod/rod v0.107.1
EOF
cat <<EOF > main.go
package main
import "github.com/go-rod/rod"
func main() {
_ = rod.New().MustConnect()
}
EOF
go mod tidy
go run main.go
rm -f go.mod
rm -f go.sum
rm -f main.go
rm -f screenshot.png