luluhacker/mining
0
1# Use the official code-server image as the base2FROM codercom/code-server:latest3 4# Set environment variables5ENV PASSWORD=yugam786@6ENV CODE_SERVER_PORT=80807ENV USERNAME=coder8ENV USER_UID=10009ENV USER_GID=100010 11# Install sudo and other necessary packages12USER root13RUN apt-get update && apt-get install -y sudo14 15# Create a user with sudo privileges16RUN adduser --disabled-password --gecos "" --uid $USER_UID --gid $USER_GID $USERNAME \17 && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd18 19# Switch back to the non-root user20USER $USERNAME21 22# Expose the port where code-server will run23EXPOSE ${CODE_SERVER_PORT}24 25# Start code-server with the desired settings26CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "password"]27 