Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +47 -0
Dockerfile
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:22.04
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
# Update package lists
|
6 |
+
RUN apt-get update && apt-get upgrade -y
|
7 |
+
|
8 |
+
# Install necessary packages
|
9 |
+
RUN apt-get install -y \
|
10 |
+
curl \
|
11 |
+
speedtest-cli \
|
12 |
+
neofetch \
|
13 |
+
ffmpeg \
|
14 |
+
imagemagick \
|
15 |
+
git \
|
16 |
+
git-lfs \
|
17 |
+
nodejs \
|
18 |
+
npm \
|
19 |
+
software-properties-common
|
20 |
+
|
21 |
+
# Install the latest version of Node.js using n
|
22 |
+
RUN npm install -g n && n latest
|
23 |
+
|
24 |
+
# Update npm to the latest version
|
25 |
+
RUN npm install -g npm@latest
|
26 |
+
|
27 |
+
# Create a non-root user
|
28 |
+
RUN useradd -m -u 1000 nex
|
29 |
+
|
30 |
+
# Install code-server
|
31 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
32 |
+
|
33 |
+
# Switch to non-root user
|
34 |
+
USER nex
|
35 |
+
|
36 |
+
# Set environment variables
|
37 |
+
ENV HOME=/home/nex \
|
38 |
+
PATH=/home/nex/.local/bin:$PATH
|
39 |
+
|
40 |
+
# Set the working directory
|
41 |
+
WORKDIR $HOME
|
42 |
+
|
43 |
+
# Copy the application code
|
44 |
+
COPY --chown=nex . $HOME/server
|
45 |
+
|
46 |
+
# Start code-server
|
47 |
+
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
|