NitinBot001 commited on
Commit
d5eac46
·
verified ·
1 Parent(s): 2935177

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +55 -125
Dockerfile CHANGED
@@ -1,125 +1,55 @@
1
- # =============================================================================
2
- # code-server-deploy-container
3
- # A standalone Docker image for hosting code-server with rclone persistence
4
- # =============================================================================
5
-
6
- # Use Ubuntu as base (code-server provides Debian/Ubuntu compatible builds)
7
- FROM codercom/code-server:latest
8
-
9
- USER root
10
-
11
- # Install system dependencies: rclone, git, and other useful tools
12
- RUN apt-get update && apt-get install -y \
13
- curl \
14
- wget \
15
- git \
16
- ca-certificates \
17
- gnupg \
18
- lsb-release \
19
- build-essential \
20
- nano \
21
- vim \
22
- htop \
23
- unzip \
24
- zip \
25
- openssh-client \
26
- --no-install-recommends \
27
- && rm -rf /var/lib/apt/lists/*
28
-
29
- # Install rclone
30
- RUN curl https://rclone.org/install.sh | bash
31
-
32
- # Create directories for persistence and scripts
33
- RUN mkdir -p /home/coder/project \
34
- /home/coder/.config \
35
- /home/coder/.local \
36
- /usr/local/bin/deploy-scripts
37
-
38
- # Copy entrypoint script
39
- COPY entrypoint.sh /usr/local/bin/deploy-scripts/entrypoint.sh
40
- RUN chmod +x /usr/local/bin/deploy-scripts/entrypoint.sh
41
-
42
- # Create scripts for rclone push/pull operations
43
- RUN cat > /home/coder/push_remote.sh << 'EOF'
44
- #!/bin/bash
45
- # Push local files to rclone remote
46
-
47
- set -e
48
-
49
- REMOTE_NAME="${RCLONE_REMOTE_NAME:-code-server-remote}"
50
- SOURCE="${RCLONE_SOURCE:-/home/coder/project}"
51
- DEST="${RCLONE_DESTINATION:-code-server-files}"
52
- FLAGS="${RCLONE_FLAGS}"
53
-
54
- echo "[push_remote] Syncing $SOURCE -> $REMOTE_NAME:$DEST"
55
- rclone sync "$SOURCE" "$REMOTE_NAME:$DEST" $FLAGS --progress
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"]