Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +21 -21
Dockerfile
CHANGED
@@ -6,25 +6,14 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
6 |
# Set environment variables
|
7 |
ENV PYTHONUNBUFFERED 1
|
8 |
|
9 |
-
# Expose the
|
10 |
-
EXPOSE 7860
|
11 |
|
12 |
# Update the package list dan upgrade existing packages
|
13 |
RUN apt update && apt upgrade -y
|
14 |
|
15 |
# Install required packages
|
16 |
-
RUN apt install -y curl
|
17 |
-
|
18 |
-
# Create a non-root user named Nex
|
19 |
-
RUN useradd -m -u 1000 Nex
|
20 |
-
|
21 |
-
# Set the password for the Nex user
|
22 |
-
RUN echo 'Nex:password' | chpasswd
|
23 |
-
|
24 |
-
# Configure SSH server
|
25 |
-
RUN mkdir /var/run/sshd
|
26 |
-
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
27 |
-
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
28 |
|
29 |
# Add NodeSource APT repository for Node 18.x
|
30 |
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
@@ -47,12 +36,23 @@ RUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 li
|
|
47 |
# Install ImageMagick
|
48 |
RUN apt install -y imagemagick
|
49 |
|
50 |
-
# Create
|
51 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
# Copy
|
54 |
-
COPY
|
55 |
-
RUN chmod +x /entrypoint.sh
|
56 |
|
57 |
-
#
|
58 |
-
|
|
|
6 |
# Set environment variables
|
7 |
ENV PYTHONUNBUFFERED 1
|
8 |
|
9 |
+
# Expose the port that the server will run on
|
10 |
+
EXPOSE 7860
|
11 |
|
12 |
# Update the package list dan upgrade existing packages
|
13 |
RUN apt update && apt upgrade -y
|
14 |
|
15 |
# Install required packages
|
16 |
+
RUN apt install -y curl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Add NodeSource APT repository for Node 18.x
|
19 |
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
|
|
36 |
# Install ImageMagick
|
37 |
RUN apt install -y imagemagick
|
38 |
|
39 |
+
# Create a non-root user named Nex and switch to it
|
40 |
+
RUN useradd -m -u 1000 Nex
|
41 |
+
USER Nex
|
42 |
+
|
43 |
+
# Set environment variables for the user
|
44 |
+
ENV HOME=/home/Nex \
|
45 |
+
PATH=/home/Nex/.local/bin:$PATH
|
46 |
+
|
47 |
+
# Set the working directory
|
48 |
+
WORKDIR $HOME/app
|
49 |
+
|
50 |
+
# Copy package.json and package-lock.json files and install dependencies
|
51 |
+
COPY --chown=Nex package*.json .
|
52 |
+
RUN npm install
|
53 |
|
54 |
+
# Copy the rest of the application code
|
55 |
+
COPY --chown=Nex . .
|
|
|
56 |
|
57 |
+
# Start the application
|
58 |
+
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
|