forked from firecrawl/firecrawl
-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (38 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
49 lines (38 loc) · 1.06 KB
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 node:20-slim AS base
# Create app directory
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm corepack@latest
RUN corepack enable
# Copy package files
COPY ./package.json ./pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Install necessary build dependencies
RUN apt-get update -qq && \
apt-get install -y \
ca-certificates \
git \
golang-go \
&& update-ca-certificates
# Copy the rest of the application
COPY . ./
# Build Go module
COPY ./src/lib/go-html-to-md/ ./src/lib/go-html-to-md/
RUN cd src/lib/go-html-to-md && \
go mod tidy && \
go build -o html-to-markdown.so -buildmode=c-shared html-to-markdown.go && \
chmod +x html-to-markdown.so
# Build the application
RUN pnpm run build
# Install runtime dependencies
RUN apt-get install --no-install-recommends -y \
chromium \
chromium-sandbox \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives
# Environment setup
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
ARG PORT=8080
ENV PORT=${PORT}
EXPOSE ${PORT}
CMD ["pnpm", "start"]