RaBU1234 commited on
Commit
c744b81
·
verified ·
1 Parent(s): 3c772bc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -5
Dockerfile CHANGED
@@ -1,24 +1,35 @@
1
  FROM node:18-alpine
2
 
3
- # Install tools including coreutils for stdbuf
4
  RUN apk add --no-cache \
5
  python3 \
6
  py3-pip \
7
  git \
8
  curl \
9
  bash \
10
- coreutils
 
11
 
12
  WORKDIR /app
13
 
 
14
  COPY package*.json ./
15
  RUN npm install
16
 
 
17
  COPY . .
18
 
19
- EXPOSE 7860
 
20
 
 
21
  RUN addgroup -S sandbox && adduser -S sandbox -G sandbox
22
- USER sandbox
23
 
24
- CMD ["node", "server.js"]
 
 
 
 
 
 
 
 
1
  FROM node:18-alpine
2
 
3
+ # Install dependencies including Nginx for multi-port proxying
4
  RUN apk add --no-cache \
5
  python3 \
6
  py3-pip \
7
  git \
8
  curl \
9
  bash \
10
+ coreutils \
11
+ nginx
12
 
13
  WORKDIR /app
14
 
15
+ # Copy package files
16
  COPY package*.json ./
17
  RUN npm install
18
 
19
+ # Copy application files
20
  COPY . .
21
 
22
+ # Setup Nginx configuration
23
+ COPY nginx.conf /etc/nginx/http.d/default.conf
24
 
25
+ # Create sandbox user
26
  RUN addgroup -S sandbox && adduser -S sandbox -G sandbox
 
27
 
28
+ # Create necessary directories
29
+ RUN mkdir -p /var/log/nginx /var/lib/nginx/tmp && \
30
+ chown -R sandbox:sandbox /var/log/nginx /var/lib/nginx /tmp/sandboxes
31
+
32
+ EXPOSE 7860
33
+
34
+ # Start both Nginx and Node.js server
35
+ CMD sh -c "nginx && su sandbox -c 'node server.js'"