Spaces:
Sleeping
Sleeping
File size: 740 Bytes
250a9db |
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 |
# Use Ubuntu 20.04 as the base image
FROM ubuntu:20.04
# Install curl to download code-server
RUN apt-get update && apt-get install -y curl
# Download and install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh
# Set the default port for code-server
ENV PORT=8081
# Set PASSWORD
ENV PASSWORD=password
# Create a non-root user with sudo privileges
RUN useradd -ms /bin/bash newuser && \
echo 'newuser:newpassword' | chpasswd && \
usermod -aG sudo newuser && \
echo 'newuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Expose the code-server port
EXPOSE 8081
# Switch to the non-root user
USER newuser
# Start code-server on container startup
CMD ["code-server", "--auth", "password", "--host", "0.0.0.0"] |