bardd commited on
Commit
6043ccf
·
verified ·
1 Parent(s): d1e82b3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -27
Dockerfile CHANGED
@@ -1,38 +1,20 @@
1
- # Build stage
2
- FROM node:20-alpine AS build
3
 
 
4
  WORKDIR /app
5
 
6
- # Copy package.json and package-lock.json (if exists)
7
  COPY package*.json ./
8
 
9
- # Install all dependencies, including devDependencies
10
- RUN npm ci
11
 
12
  # Copy the rest of your application code
13
  COPY . .
14
 
15
- # Build the application
16
- RUN npm run build
17
-
18
- # Production stage
19
- FROM node:20-alpine AS production
20
-
21
- WORKDIR /app
22
-
23
- # Copy package.json and package-lock.json (if exists)
24
- COPY package*.json ./
25
-
26
- # Install only production dependencies
27
- # Since there are no production dependencies, this step will be quick
28
- RUN npm ci --only=production
29
-
30
- # Copy built assets from the build stage
31
- COPY --from=build /app/dist ./dist
32
-
33
- ENV NODE_ENV production
34
- ENV PORT 7860
35
-
36
  EXPOSE 7860
37
 
38
- CMD ["npm", "run", "start:prod"]
 
 
1
+ # Use Node.js 20 as the base image
2
+ FROM node:20-alpine
3
 
4
+ # Set the working directory in the container
5
  WORKDIR /app
6
 
7
+ # Copy package.json and package-lock.json (if available)
8
  COPY package*.json ./
9
 
10
+ # Install dependencies
11
+ RUN npm install
12
 
13
  # Copy the rest of your application code
14
  COPY . .
15
 
16
+ # Expose the port your app runs on
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  EXPOSE 7860
18
 
19
+ # Command to run your app in development mode
20
+ CMD ["npm", "run", "start:dev"]