Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +55 -125
Dockerfile
CHANGED
|
@@ -1,125 +1,55 @@
|
|
| 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 |
-
RUN
|
| 41 |
-
|
| 42 |
-
#
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
#
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
echo "[push_remote] Complete!"
|
| 57 |
-
EOF
|
| 58 |
-
|
| 59 |
-
RUN cat > /home/coder/pull_remote.sh << 'EOF'
|
| 60 |
-
#!/bin/bash
|
| 61 |
-
# Pull files from rclone remote to local
|
| 62 |
-
|
| 63 |
-
set -e
|
| 64 |
-
|
| 65 |
-
REMOTE_NAME="${RCLONE_REMOTE_NAME:-code-server-remote}"
|
| 66 |
-
SOURCE="${RCLONE_SOURCE:-/home/coder/project}"
|
| 67 |
-
DEST="${RCLONE_DESTINATION:-code-server-files}"
|
| 68 |
-
FLAGS="${RCLONE_FLAGS}"
|
| 69 |
-
|
| 70 |
-
echo "[pull_remote] Syncing $REMOTE_NAME:$DEST -> $SOURCE"
|
| 71 |
-
rclone sync "$REMOTE_NAME:$DEST" "$SOURCE" $FLAGS --progress
|
| 72 |
-
echo "[pull_remote] Complete!"
|
| 73 |
-
EOF
|
| 74 |
-
|
| 75 |
-
RUN chmod +x /home/coder/push_remote.sh /home/coder/pull_remote.sh
|
| 76 |
-
|
| 77 |
-
# Set up VS Code tasks for rclone if enabled
|
| 78 |
-
RUN mkdir -p /home/coder/.vscode
|
| 79 |
-
RUN cat > /home/coder/.vscode/tasks.json << 'EOF'
|
| 80 |
-
{
|
| 81 |
-
"version": "2.0.0",
|
| 82 |
-
"tasks": [
|
| 83 |
-
{
|
| 84 |
-
"label": "push_remote",
|
| 85 |
-
"type": "shell",
|
| 86 |
-
"command": "sh /home/coder/push_remote.sh",
|
| 87 |
-
"problemMatcher": [],
|
| 88 |
-
"group": "build"
|
| 89 |
-
},
|
| 90 |
-
{
|
| 91 |
-
"label": "pull_remote",
|
| 92 |
-
"type": "shell",
|
| 93 |
-
"command": "sh /home/coder/pull_remote.sh",
|
| 94 |
-
"problemMatcher": [],
|
| 95 |
-
"group": "build"
|
| 96 |
-
}
|
| 97 |
-
]
|
| 98 |
-
}
|
| 99 |
-
EOF
|
| 100 |
-
|
| 101 |
-
# Fix permissions
|
| 102 |
-
RUN chown -R coder:coder /home/coder
|
| 103 |
-
|
| 104 |
-
# Environment variables defaults
|
| 105 |
-
ENV PASSWORD="111111" \
|
| 106 |
-
HASHED_PASSWORD="" \
|
| 107 |
-
USE_LINK=false \
|
| 108 |
-
GIT_REPO="" \
|
| 109 |
-
DOTFILES_REPO="" \
|
| 110 |
-
DOTFILES_SYMLINK=true \
|
| 111 |
-
START_DIR="/home/coder/project" \
|
| 112 |
-
RCLONE_REMOTE_NAME="code-server-remote" \
|
| 113 |
-
RCLONE_SOURCE="/home/coder/project" \
|
| 114 |
-
RCLONE_DESTINATION="code-server-files" \
|
| 115 |
-
RCLONE_VSCODE_TASKS=true \
|
| 116 |
-
RCLONE_AUTO_PUSH=true \
|
| 117 |
-
RCLONE_AUTO_PULL=true \
|
| 118 |
-
RCLONE_DATA="" \
|
| 119 |
-
RCLONE_FLAGS=""
|
| 120 |
-
|
| 121 |
-
# Expose code-server port
|
| 122 |
-
EXPOSE 8080
|
| 123 |
-
|
| 124 |
-
# Use custom entrypoint
|
| 125 |
-
ENTRYPOINT ["/usr/local/bin/deploy-scripts/entrypoint.sh"]
|
|
|
|
| 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 |
+
# Remove rust & cargo from apk
|
| 22 |
+
RUN apk add --no-cache bash curl git python3 make build-base libc-dev linux-headers postgresql-dev nodejs npm redis shadow
|
| 23 |
+
|
| 24 |
+
# Install rustup and nightly Rust
|
| 25 |
+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
|
| 26 |
+
&& source $HOME/.cargo/env \
|
| 27 |
+
&& rustup install nightly \
|
| 28 |
+
&& rustup default nightly
|
| 29 |
+
|
| 30 |
+
# Install pnpm globally
|
| 31 |
+
RUN npm install -g pnpm
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# --- Create non-root user ---
|
| 35 |
+
RUN addgroup -g 1000 appgroup && \
|
| 36 |
+
adduser -D -u 1000 -G appgroup appuser
|
| 37 |
+
|
| 38 |
+
# Set working directory with correct permissions
|
| 39 |
+
WORKDIR /opt/firecrawl
|
| 40 |
+
RUN chown -R appuser:appgroup /opt/firecrawl
|
| 41 |
+
|
| 42 |
+
# Switch to non-root user
|
| 43 |
+
USER appuser
|
| 44 |
+
|
| 45 |
+
# Clone Firecrawl repo
|
| 46 |
+
RUN git clone https://github.com/firecrawl/firecrawl.git .
|
| 47 |
+
|
| 48 |
+
# Back to project root
|
| 49 |
+
WORKDIR /opt/firecrawl
|
| 50 |
+
|
| 51 |
+
# Expose Firecrawl ports
|
| 52 |
+
EXPOSE 3002
|
| 53 |
+
|
| 54 |
+
# Default command: requires docker.sock mounted to run docker-compose
|
| 55 |
+
CMD ["docker-compose", "-f", "docker-compose.yaml", "up", "--build"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|