codeserver / Dockerfile
ar08's picture
Update Dockerfile
4e6a9b5 verified
raw
history blame
1.51 kB
# Use Python 3.9 as the base image
FROM python:3.9
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages
RUN apt-get update && \
apt-get install -y \
curl \
sudo \
build-essential \
default-jdk \
default-jre \
g++ \
gcc \
libzbar0 \
fish \
ffmpeg
# Install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh
# Create a user to run code-server
RUN useradd -m -s /bin/bash coder && \
echo 'coder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Create and set the working directory
RUN mkdir -p /home/coder/genz
WORKDIR /home/coder/genz
# Change ownership of the working directory
RUN chown -R coder:coder /home/coder/genz
# Create code-server configuration directory
RUN mkdir -p /home/coder/.config/code-server
# Add settings.json to enable dark mode
RUN echo '{ \
"workbench.colorTheme": "Default Dark+", \
"telemetry.enableTelemetry": false, \
"telemetry.enableCrashReporter": false \
}' > /home/coder/.config/code-server/settings.json
# Change ownership of the configuration directory
RUN chown -R coder:coder /home/coder/.config
# Expose the default code-server port
EXPOSE 8080
# Define a volume for the genz folder
#VOLUME /home/coder/genz #I AM HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Switch to the coder user for running code-server
USER coder
WORKDIR /genz
# Start code-server
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
# End of Dockerfile