/
Dockerfile
49 lines (40 loc) · 1.78 KB
/
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
41
42
43
44
45
46
47
48
49
FROM debian:stretch AS server
LABEL org.opencontainers.image.source "https://github.com/perfsee/perfsee"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
DEBIAN_FRONTEND="noninteractive" \
PATH=/root/.fnm:/root/.fnm/aliases/default/bin:$PATH
SHELL ["/bin/bash", "-c"]
RUN cat /etc/apt/sources.list && \
apt-get update && \
apt-get install procps curl unzip git libsecret-1-dev ca-certificates gnupg2 -y --no-install-recommends --fix-missing && \
# https://github.com/Schniz/fnm
curl -fsSL --insecure https://fnm.vercel.app/install | bash && \
source ~/.bashrc && \
fnm install --lts && \
npm install yarn --location=global
FROM server AS runner
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
RUN curl -sS https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install xvfb libjpeg-dev ffmpeg google-chrome-stable -y --no-install-recommends --fix-missing
FROM runner AS develop
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN apt-get install build-essential -y --no-install-recommends --fix-missing
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
FROM ghcr.io/perfsee/perfsee/develop:latest as compose_develop
ADD . /code
WORKDIR /code
RUN yarn
FROM ghcr.io/perfsee/perfsee/server:latest AS deploy
ADD . /code
WORKDIR /code
RUN yarn && yarn build
CMD ["node", "-r", "./tools/paths-register", "packages/platform-server/dist/index.js"]
FROM ghcr.io/perfsee/perfsee/runner:latest as runner_deploy
ADD . /code
WORKDIR /code
RUN yarn && yarn build
CMD ["node", "-r", "./tools/paths-register", "packages/runner/executor/dist/index.js"]