-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
122 lines (101 loc) · 4.41 KB
/
Dockerfile
File metadata and controls
122 lines (101 loc) · 4.41 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
FROM codercom/code-server:latest
USER root
# Create a workspace directory at root level
RUN mkdir -p /workspace
WORKDIR /workspace
# Install dependencies including those needed for Goose
RUN apt-get update && apt-get install -y \
curl \
git \
bzip2 \
libdbus-1-3 \
sudo \
expect \
tmux \
python3 \
python3-pip \
python3-venv \
# GitHub CLI repo and key
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install -y gh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy goose-api requirements.txt for dependency installation
COPY ./goose-api/requirements.txt /tmp/requirements.txt
# Set up a Python virtual environment for the Goose API
RUN python3 -m venv /opt/goose-api-venv
ENV PATH="/opt/goose-api-venv/bin:$PATH"
RUN pip3 install --upgrade pip && pip3 install -r /tmp/requirements.txt
# Install Goose AI agent (simple one-step process)
RUN curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash \
&& chmod +x /root/.local/bin/goose \
&& mv /root/.local/bin/goose /usr/local/bin/goose
# Add the coder user to sudoers
RUN echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Copy scripts and static files
COPY ./github-setup.sh /usr/local/bin/github-setup.sh
RUN chmod +x /usr/local/bin/github-setup.sh
COPY ./install-goose.sh /usr/local/bin/install-goose.sh
RUN chmod +x /usr/local/bin/install-goose.sh
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Copy static resources
COPY ./static /workspace/static
RUN chmod -R 755 /workspace/static
# Copy goose-api directory
COPY ./goose-api /workspace/goose-api
RUN chmod +x /workspace/goose-api/docker-integration.sh
RUN chmod -R +x /workspace/goose-api/examples/
# Create configuration directories
RUN mkdir -p /home/coder/.local/share/code-server/User/
RUN mkdir -p /home/coder/.config/code-server/
# Create settings.json with dark theme and material icons configuration
RUN echo '{ \
"workbench.colorTheme": "Default Dark+", \
"workbench.iconTheme": "material-icon-theme", \
"workbench.productIconTheme": "material-product-icons", \
"workbench.colorCustomizations": { \
"editor.background": "#1e1e1e", \
"sideBar.background": "#1e1e1e", \
"activityBar.background": "#1e1e1e", \
"terminal.background": "#1e1e1e", \
"statusBar.background": "#1e1e1e", \
"editor.foreground": "#e0e0e0", \
"editor.selectionBackground": "#515c6a", \
"editorCursor.foreground": "#00ff33", \
"panel.background": "#1e1e1e" \
}, \
"workbench.startupEditor": "none", \
"workbench.settings.editor": "json", \
"editor.fontSize": 14, \
"workbench.preferredDarkColorTheme": "Default Dark+", \
"workbench.welcomePage.enabled": false, \
"workbench.tips.enabled": false, \
"update.showReleaseNotes": false, \
"telemetry.telemetryLevel": "off", \
"window.dialogStyle": "native" \
}' > /home/coder/.local/share/code-server/User/settings.json
# Configure code-server to use the dark theme and disable welcome page
RUN echo "bind-addr: 0.0.0.0:8080\nauth: password\ncert: false\nuser-data-dir: /home/coder/.local/share/code-server\nextensions-dir: /home/coder/.local/share/code-server/extensions\ndisable-telemetry: true\ndisable-update-check: true" > /home/coder/.config/code-server/config.yaml
# Fix for product.json directory vs file issue
RUN rm -rf /home/coder/.local/share/code-server/product.json && \
echo '{ \
"welcomePage": false, \
"welcomePageVisible": false, \
"showWelcomeDialog": false \
}' > /home/coder/.local/share/code-server/product.json
# Set proper permissions
RUN chown -R coder:coder /workspace && chmod -R 755 /workspace
RUN chown -R coder:coder /home/coder
# Switch back to coder user
USER coder
# Set environment variables to disable welcome
ENV CS_DISABLE_GETTING_STARTED_OVERRIDE=1
ENV CS_DISABLE_WELCOME=true
# Expose the port
EXPOSE 8080
# Use the entrypoint script to start everything
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]