-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (52 loc) · 1.59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM node:18 as base
SHELL ["/bin/bash", "-c"]
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
# core libs
RUN apt-get update && apt-get install -y \
unzip \
curl \
python3 \
python-is-python3 \
g++ \
libc-dev \
openjdk-17-jdk && \
# For puppeteer and FSIM
apt-get install -y libxkbcommon-x11-0 libgbm-dev python3-pip && \
pip3 install --no-cache-dir opencv-python scikit-image image-similarity-measures pyfftw --break-system-packages &&\
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN npx prisma generate && \
mkdir -p dist/turbodrive/.tmp && \
mkdir -p turbodrive/.tmp \
mkdir -p dist/tmp/templates && \
mkdir -p tmp/templates \
mkdir -p python/tmp
RUN yarn build
FROM node:18 as production
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y \
unzip \
curl \
python3 \
python-is-python3 \
g++ \
libc-dev \
openjdk-17-jdk && \
# For puppeteer and FSIM
apt-get install -y libxkbcommon-x11-0 libgbm-dev python3-pip && \
pip3 install --no-cache-dir opencv-python scikit-image image-similarity-measures pyfftw --break-system-packages &&\
apt-get clean && rm -rf /var/lib/apt/lists/*
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
WORKDIR /app
COPY package.json yarn.lock prisma/ ./
RUN yarn install --frozen-lockfile --production && \
yarn cache clean && \
npx prisma generate && \
rm -rf /tmp/* /usr/local/share/.cache/yarn/v6
COPY --from=base /app/dist ./dist
COPY --from=base /app/python ./dist/python