-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (38 loc) · 1.39 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
# Stage for downloading curl-impersonate
FROM debian:bullseye AS curl-impersonate
# Install necessary packages, including ca-certificates for SSL verification
RUN apt-get update && apt-get install -y \
wget \
tar \
ca-certificates \
--no-install-recommends && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/lwthiker/curl-impersonate/releases/download/v0.6.1/curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz \
&& tar -xvzf curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz \
&& rm curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz
RUN ls ./curl-impersonate-chrome
# Main build stage
FROM node:20-bullseye
# Copy curl-impersonate-chrome from the previous stage directly into the main stage
COPY --from=curl-impersonate /curl-impersonate-chrome /usr/local/bin/curl-impersonate-chrome
RUN apt-get update && apt-get install -y \
libnss3 \
nss-plugin-pem \
ca-certificates \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Enable corepack and prepare pnpm
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /app
COPY ./package.json ./package.json
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./patches ./patches
# Install dependencies
RUN pnpm install
# Copy the rest of the application files
COPY . .
# Build the application
RUN pnpm build
# For running image beyond docker compose
CMD ["pnpm", "start"]