Zonex999 commited on
Commit
14e5043
·
verified ·
1 Parent(s): ab6e343

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -16
Dockerfile CHANGED
@@ -1,23 +1,18 @@
1
- # Use official Node.js LTS image
2
- FROM node:18
3
 
4
- # Create app directory inside container
5
- WORKDIR /usr/src/app
6
 
7
- # Copy package.json and package-lock.json (if exists)
8
  COPY package*.json ./
 
9
 
10
- # Install dependencies (express)
11
- RUN npm init -y
12
- Run npm install express
13
- Run apt install tmate
14
- Run tmate
15
-
16
- # Copy server.js into container
17
  COPY server.js .
18
 
19
- # Expose port 3000
20
- EXPOSE 3000
21
 
22
- # Command to run the server
23
- CMD ["node", "server.js"
 
1
+ # Use official Node image
2
+ FROM node:18-alpine
3
 
4
+ # Create app directory
5
+ WORKDIR /app
6
 
7
+ # Install app dependencies
8
  COPY package*.json ./
9
+ RUN npm install
10
 
11
+ # Copy source
 
 
 
 
 
 
12
  COPY server.js .
13
 
14
+ # Expose port
15
+ EXPOSE 7860
16
 
17
+ # Run the server
18
+ CMD ["node", "server.js"]