Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (60 loc) · 2.09 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (60 loc) · 2.09 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
FROM node:22-bookworm-slim AS web-build
WORKDIR /web
COPY web/package.json web/package-lock.json ./
RUN npm ci
COPY web/ ./
RUN npm run build
FROM python:3.12-slim-bookworm
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
ENVIRONMENT=production \
DEBUG=false \
VENV_DIR=/opt/venv \
PROJECTS_ROOT=/home/remote-coder/projects \
REMOTE_CODER_DATA_ROOT=/home/remote-coder/.remote-coder
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
git \
git-lfs \
gh \
nginx \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://code-server.dev/install.sh | sh
# agent-browser drives a real Chrome (For Testing) for the live browser tab.
# Chrome is downloaded into the runtime user's home so the server can launch it.
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g agent-browser \
&& HOME=/home/remote-coder agent-browser install --with-deps \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --shell /bin/bash remote-coder \
&& mkdir -p \
/app/database \
/app/storage/logs \
/home/remote-coder/projects \
/home/remote-coder/.remote-coder/vscode/cache \
/tmp/nginx/client_body \
/tmp/nginx/proxy \
/tmp/nginx/fastcgi \
/tmp/nginx/uwsgi \
/tmp/nginx/scgi \
&& chown -R remote-coder:remote-coder \
/app \
/home/remote-coder \
/tmp/nginx
WORKDIR /app
COPY --chown=remote-coder:remote-coder pyproject.toml README.md ./
COPY --chown=remote-coder:remote-coder app ./app
COPY --from=web-build --chown=remote-coder:remote-coder /web/dist ./web/dist
COPY nginx.conf /etc/nginx/nginx.conf
COPY scripts/entrypoint.sh /usr/local/bin/remote-coder-entrypoint
RUN python -m venv "$VENV_DIR" \
&& "$VENV_DIR/bin/pip" install --no-cache-dir . \
&& chmod 755 /usr/local/bin/remote-coder-entrypoint
USER remote-coder
EXPOSE 8000
STOPSIGNAL SIGTERM
CMD ["/usr/local/bin/remote-coder-entrypoint"]