| |
| |
| |
| FROM ubuntu:22.04 |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && apt-get install -y sudo \ |
| && useradd -m -s /bin/bash coder \ |
| && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers |
|
|
| USER root |
| WORKDIR /home/coder |
|
|
| |
| |
| |
| RUN apt-get update && apt-get install -y \ |
| curl wget git unzip zip build-essential gnupg ca-certificates \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| |
| |
| RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| && apt-get install -y nodejs \ |
| && npm install -g yarn pnpm |
|
|
| |
| |
| |
| RUN curl -fsSL https://code-server.dev/install.sh | sh |
|
|
| |
| |
| |
| RUN mkdir -p /home/coder/workspace /home/coder/.config/code-server /home/coder/.local/share/code-server \ |
| && chown -R coder:coder /home/coder |
|
|
| |
| |
| |
| USER coder |
| WORKDIR /home/coder/workspace |
|
|
| |
| ENV PASSWORD=mernpassword |
|
|
| |
| RUN echo "bind-addr: 0.0.0.0:7860\nauth: password\npassword: ${PASSWORD}\ncert: false" > /home/coder/.config/code-server/config.yaml |
|
|
| |
| |
| |
| EXPOSE 7860 |
| CMD ["bash", "-c", "PASSWORD=${PASSWORD} code-server --config /home/coder/.config/code-server/config.yaml --user-data-dir /home/coder/.local/share/code-server"] |
|
|