Nexchan commited on
Commit
f73e0fd
1 Parent(s): b900167

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -37
Dockerfile CHANGED
@@ -1,47 +1,26 @@
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"]
 
1
+ FROM node:latest
2
 
3
+ RUN apt-get update && \
4
+ apt-get install -y neofetch ffmpeg curl python3 python3-pip python3-venv build-essential libvips libvips-dev libjpeg-dev libpng-dev && \
5
+ rm -rf /var/lib/apt/lists/*
6
 
7
+ WORKDIR /app
 
8
 
9
+ COPY package.json .
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ RUN npm install -g npm@latest node-gyp
 
12
 
13
+ RUN npm install
 
14
 
15
+ # Create and activate a virtual environment
16
+ RUN python3 -m venv /venv
17
+ ENV PATH="/venv/bin:$PATH"
18
 
19
+ # Install speedtest-cli within the virtual environment
20
+ RUN pip install --no-cache-dir speedtest-cli
21
 
22
+ COPY . .
 
23
 
24
+ EXPOSE 7860
 
 
25
 
26
+ CMD ["node", "index.js"]