Spaces:
Sleeping
Sleeping
changwenhan
commited on
Update Dockerfile
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
# Use an official Node.js LTS version that uses glibc
|
2 |
FROM node:18-bullseye-slim
|
3 |
|
|
|
|
|
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
@@ -16,10 +19,7 @@ COPY . .
|
|
16 |
# Expose the port the app runs on
|
17 |
EXPOSE 7860
|
18 |
|
19 |
-
#
|
20 |
-
ENV PORT=7860
|
21 |
-
|
22 |
-
# Create an entrypoint script to set sysctl and ulimit settings
|
23 |
RUN echo "#!/bin/sh" > /entrypoint.sh && \
|
24 |
echo "sysctl -w net.ipv4.ip_local_port_range='1024 65535'" >> /entrypoint.sh && \
|
25 |
echo "sysctl -w net.ipv4.tcp_mem='131072 262144 524288'" >> /entrypoint.sh && \
|
@@ -31,7 +31,7 @@ RUN echo "#!/bin/sh" > /entrypoint.sh && \
|
|
31 |
echo "sysctl -w net.ipv4.tcp_max_syn_backlog=2048" >> /entrypoint.sh && \
|
32 |
echo "sysctl -w net.core.netdev_max_backlog=2048" >> /entrypoint.sh && \
|
33 |
echo "sysctl -w net.ipv4.tcp_tw_reuse=1" >> /entrypoint.sh && \
|
34 |
-
echo "ulimit -n 2000500" >> /entrypoint.sh && \
|
35 |
echo "exec \"\$@\"" >> /entrypoint.sh && \
|
36 |
chmod +x /entrypoint.sh
|
37 |
|
|
|
1 |
# Use an official Node.js LTS version that uses glibc
|
2 |
FROM node:18-bullseye-slim
|
3 |
|
4 |
+
# Install sysctl (procps package)
|
5 |
+
RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*
|
6 |
+
|
7 |
# Set the working directory in the container
|
8 |
WORKDIR /app
|
9 |
|
|
|
19 |
# Expose the port the app runs on
|
20 |
EXPOSE 7860
|
21 |
|
22 |
+
# Create an entrypoint script to set sysctl settings
|
|
|
|
|
|
|
23 |
RUN echo "#!/bin/sh" > /entrypoint.sh && \
|
24 |
echo "sysctl -w net.ipv4.ip_local_port_range='1024 65535'" >> /entrypoint.sh && \
|
25 |
echo "sysctl -w net.ipv4.tcp_mem='131072 262144 524288'" >> /entrypoint.sh && \
|
|
|
31 |
echo "sysctl -w net.ipv4.tcp_max_syn_backlog=2048" >> /entrypoint.sh && \
|
32 |
echo "sysctl -w net.core.netdev_max_backlog=2048" >> /entrypoint.sh && \
|
33 |
echo "sysctl -w net.ipv4.tcp_tw_reuse=1" >> /entrypoint.sh && \
|
34 |
+
echo "ulimit -n 2000500 || true" >> /entrypoint.sh && \
|
35 |
echo "exec \"\$@\"" >> /entrypoint.sh && \
|
36 |
chmod +x /entrypoint.sh
|
37 |
|