NitinBot001 commited on
Commit
07c9f6f
·
verified ·
1 Parent(s): e1fd6f5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -10
Dockerfile CHANGED
@@ -1,14 +1,48 @@
1
- FROM docker:27-cli # Docker CLI only (lighter than full dind)
 
2
 
3
- # Install dependencies: git, python3, pip, and docker-compose
4
- RUN apk add --no-cache git py3-pip python3 \
5
- && pip install docker-compose
 
 
 
 
 
 
 
6
 
7
- # Set working directory
8
- WORKDIR /app
9
 
10
- # Clone the Firecrawl repository
11
- RUN git clone https://github.com/firecrawl/firecrawl.git .
 
 
12
 
13
- # Default command to run docker-compose
14
- CMD ["docker-compose", "up"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base: docker CLI image (lighter than full dind)
2
+ FROM docker:27-cli
3
 
4
+ # Install required packages
5
+ RUN apk add --no-cache \
6
+ git \
7
+ nodejs \
8
+ npm \
9
+ python3 \
10
+ make \
11
+ bash \
12
+ curl \
13
+ shadow
14
 
15
+ # Install pnpm globally
16
+ RUN npm install -g pnpm
17
 
18
+ # --- Create non-root user ---
19
+ # Create group and user (uid/gid = 1000 by convention)
20
+ RUN addgroup -g 1000 appgroup && \
21
+ adduser -D -u 1000 -G appgroup appuser
22
 
23
+ # Set working directory with correct ownership
24
+ WORKDIR /opt/firecrawl
25
+ RUN chown -R appuser:appgroup /opt/firecrawl
26
+
27
+ # Switch to non-root user
28
+ USER appuser
29
+
30
+ # Clone Firecrawl repo (user has permissions now)
31
+ RUN git clone https://github.com/firecrawl/firecrawl.git .
32
+
33
+ # Install dependencies inside API & services
34
+ WORKDIR /opt/firecrawl/apps/api
35
+ RUN pnpm install
36
+
37
+ WORKDIR /opt/firecrawl/apps/playwright-service
38
+ RUN pnpm install
39
+
40
+ # Back to root project folder
41
+ WORKDIR /opt/firecrawl
42
+
43
+ # Expose ports
44
+ EXPOSE 3002
45
+ # EXPOSE 3000
46
+
47
+ # Run docker-compose (container must be started with mounted docker.sock)
48
+ CMD ["docker-compose", "-f", "docker-compose.yaml", "up", "--build"]