enzostvs HF staff commited on
Commit
b3faf9b
1 Parent(s): 8a0c38c

build command

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -6
Dockerfile CHANGED
@@ -1,13 +1,26 @@
 
1
 
2
- FROM node:16-alpine
 
 
3
 
4
- RUN npm install -g pnpm
 
5
 
6
- WORKDIR /app
7
- RUN npm install --frozen-lockfile
8
 
9
- COPY . .
 
 
 
 
 
 
10
  RUN npm run build
11
 
 
12
  EXPOSE 3000
13
- CMD ["node", "build"]
 
 
 
1
+ # Dockerfile
2
 
3
+ # Use an official Node.js runtime as the base image
4
+ FROM node:18
5
+ USER 1000
6
 
7
+ # Set the working directory in the container
8
+ WORKDIR /usr/src/app
9
 
10
+ # Copy package.json and package-lock.json to the container
11
+ COPY --chown=1000 package.json package-lock.json ./
12
 
13
+ # Install dependencies
14
+ RUN npm install
15
+
16
+ # Copy the rest of the application files to the container
17
+ COPY --chown=1000 . .
18
+
19
+ # Build the Svelte Kit application for production
20
  RUN npm run build
21
 
22
+ # Expose the application port (assuming your app runs on port 3000)
23
  EXPOSE 3000
24
+
25
+ # Run the application in production mode
26
+ CMD ["node", "build/index.js"]