Nexchan commited on
Commit
c76a212
·
verified ·
1 Parent(s): 2558d03

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +60 -10
Dockerfile CHANGED
@@ -1,17 +1,67 @@
1
- FROM node:latest
2
 
3
- RUN apt-get update && \
4
- apt-get install -y curl && \
5
- rm -rf /var/lib/apt/lists/*
6
 
7
- WORKDIR /app
 
8
 
9
- COPY package.json .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- RUN npm install
 
12
 
13
- COPY . .
 
14
 
15
- EXPOSE 7860
 
16
 
17
- CMD ["npm", "start"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:focal
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
4
 
5
+ # Update package lists and upgrade existing packages
6
+ RUN apt-get update && apt-get upgrade -y
7
 
8
+ # Install necessary packages
9
+ RUN apt-get install -y \
10
+ curl \
11
+ neofetch \
12
+ ffmpeg \
13
+ imagemagick \
14
+ git \
15
+ git-lfs \
16
+ nodejs \
17
+ npm \
18
+ software-properties-common \
19
+ python3 \
20
+ python3-pip \
21
+ python3-venv \
22
+ build-essential \
23
+ libvips \
24
+ libvips-dev \
25
+ libjpeg-dev \
26
+ libpng-dev \
27
+ chromium-browser \
28
+ libgbm-dev \
29
+ xvfb
30
 
31
+ # Install speedtest-cli using pip
32
+ RUN pip install --no-cache-dir speedtest-cli
33
 
34
+ # Install the latest version of Node.js using n
35
+ RUN npm install -g n && n latest
36
 
37
+ # Update npm to the latest version
38
+ RUN npm install -g npm@latest
39
 
40
+ # Install Puppeteer
41
+ RUN npm install puppeteer
42
+
43
+ # Create a non-root user
44
+ RUN useradd -m -u 1000 nex
45
+
46
+ # Install code-server
47
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
48
+
49
+ # Set up Python virtual environment
50
+ RUN python3 -m venv /venv
51
+ ENV PATH="/venv/bin:$PATH"
52
+
53
+ # Switch to non-root user
54
+ USER nex
55
+
56
+ # Set environment variables
57
+ ENV HOME=/home/nex \
58
+ PATH=/home/nex/.local/bin:$PATH
59
+
60
+ # Set the working directory
61
+ WORKDIR $HOME
62
+
63
+ # Copy the application code
64
+ COPY --chown=nex . $HOME/server
65
+
66
+ # Start code-server
67
+ CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]