Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +21 -17
Dockerfile
CHANGED
|
@@ -1,49 +1,53 @@
|
|
| 1 |
-
# Base: docker CLI image (lighter than full dind)
|
| 2 |
FROM docker:27-cli
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
RUN apk add --no-cache \
|
|
|
|
|
|
|
| 6 |
git \
|
| 7 |
-
nodejs \
|
| 8 |
-
npm \
|
| 9 |
python3 \
|
| 10 |
make \
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
shadow \
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
# Install pnpm globally
|
| 17 |
-
# bash
|
| 18 |
RUN npm install -g pnpm
|
|
|
|
| 19 |
# --- Create non-root user ---
|
| 20 |
-
# Create group and user (uid/gid = 1000 by convention)
|
| 21 |
RUN addgroup -g 1000 appgroup && \
|
| 22 |
adduser -D -u 1000 -G appgroup appuser
|
| 23 |
|
| 24 |
-
# Set working directory with correct
|
| 25 |
WORKDIR /opt/firecrawl
|
| 26 |
RUN chown -R appuser:appgroup /opt/firecrawl
|
| 27 |
|
| 28 |
# Switch to non-root user
|
| 29 |
USER appuser
|
| 30 |
|
| 31 |
-
# Clone Firecrawl repo
|
| 32 |
-
RUN git clone https://github.com/firecrawl/firecrawl.git .
|
| 33 |
|
| 34 |
-
# Install dependencies
|
| 35 |
WORKDIR /opt/firecrawl/apps/api
|
| 36 |
RUN pnpm install
|
| 37 |
|
|
|
|
| 38 |
WORKDIR /opt/firecrawl/apps/playwright-service
|
| 39 |
RUN pnpm install
|
| 40 |
|
| 41 |
-
# Back to
|
| 42 |
WORKDIR /opt/firecrawl
|
| 43 |
|
| 44 |
-
# Expose ports
|
| 45 |
EXPOSE 3002
|
| 46 |
-
# EXPOSE 3000
|
| 47 |
|
| 48 |
-
#
|
| 49 |
CMD ["docker-compose", "-f", "docker-compose.yaml", "up", "--build"]
|
|
|
|
|
|
|
| 1 |
FROM docker:27-cli
|
| 2 |
|
| 3 |
+
# Install system dependencies, dev tools, Rust
|
| 4 |
RUN apk add --no-cache \
|
| 5 |
+
bash \
|
| 6 |
+
curl \
|
| 7 |
git \
|
|
|
|
|
|
|
| 8 |
python3 \
|
| 9 |
make \
|
| 10 |
+
build-base \
|
| 11 |
+
libc-dev \
|
| 12 |
+
linux-headers \
|
| 13 |
+
postgresql-dev \
|
| 14 |
+
nodejs \
|
| 15 |
+
npm \
|
| 16 |
+
redis \
|
| 17 |
shadow \
|
| 18 |
+
rust \
|
| 19 |
+
cargo
|
| 20 |
|
| 21 |
# Install pnpm globally
|
|
|
|
| 22 |
RUN npm install -g pnpm
|
| 23 |
+
|
| 24 |
# --- Create non-root user ---
|
|
|
|
| 25 |
RUN addgroup -g 1000 appgroup && \
|
| 26 |
adduser -D -u 1000 -G appgroup appuser
|
| 27 |
|
| 28 |
+
# Set working directory with correct permissions
|
| 29 |
WORKDIR /opt/firecrawl
|
| 30 |
RUN chown -R appuser:appgroup /opt/firecrawl
|
| 31 |
|
| 32 |
# Switch to non-root user
|
| 33 |
USER appuser
|
| 34 |
|
| 35 |
+
# Clone Firecrawl repo
|
| 36 |
+
RUN git clone https://github.com/firecrawl/firecrawl.git .
|
| 37 |
|
| 38 |
+
# Install JS dependencies for API
|
| 39 |
WORKDIR /opt/firecrawl/apps/api
|
| 40 |
RUN pnpm install
|
| 41 |
|
| 42 |
+
# Install JS dependencies for Playwright service
|
| 43 |
WORKDIR /opt/firecrawl/apps/playwright-service
|
| 44 |
RUN pnpm install
|
| 45 |
|
| 46 |
+
# Back to project root
|
| 47 |
WORKDIR /opt/firecrawl
|
| 48 |
|
| 49 |
+
# Expose Firecrawl ports
|
| 50 |
EXPOSE 3002
|
|
|
|
| 51 |
|
| 52 |
+
# Default command: requires docker.sock mounted to run docker-compose
|
| 53 |
CMD ["docker-compose", "-f", "docker-compose.yaml", "up", "--build"]
|