-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 1.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use an official Node.js runtime as the base image
FROM node:18.16.0 AS build
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and yarn.lock to the working directory
COPY package.json yarn.lock ./
# Install dependencies
RUN yarn install && yarn cache clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy the rest of the application code to the working directory
COPY . .
# Expose the port your Node.js app is listening on
EXPOSE 3000
# EXPOSE 443
# Command to start your Node.js app
CMD [ "node", "server.js" ]
#cd /var/www/node-chat
#docker build -t my-node-app .
#docker run -d -p 3001:3000 --name node_chat my-node-app
#rebuild
#docker build -t my-node-app .
#docker stop node_chat
#docker container rm node_chat
#docker run -d -p 3001:3000 --name node_chat my-node-app
#docker run -d --restart=always -p 3001:3000 --name node_chat my-node-app
#docker run -d --restart=unless-stopped -p 3001:3000 --name node_chat my-node-app
#curl "http://localhost:3001/socket.io/?EIO=4&transport=polling"
#netstat -tlpn