# Use the official code-server image as the base FROM codercom/code-server:latest # Set environment variables ENV PASSWORD=yugam786@ ENV CODE_SERVER_PORT=8080 ENV USERNAME=coder ENV USER_UID=1000 ENV USER_GID=1000 # Install sudo and other necessary packages USER root RUN apt-get update && apt-get install -y sudo # Create a user with sudo privileges RUN adduser --disabled-password --gecos "" --uid $USER_UID --gid $USER_GID $USERNAME \ && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd # Switch back to the non-root user USER $USERNAME # Expose the port where code-server will run EXPOSE ${CODE_SERVER_PORT} # Start code-server with the desired settings CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "password"]