Charan5775 commited on
Commit
2ef49d7
·
verified ·
1 Parent(s): 8f7821c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -3,13 +3,16 @@ FROM ${BASE} AS base
3
 
4
  WORKDIR /app
5
 
6
- # Install dependencies (this step is cached as long as the dependencies don't change)
7
- COPY package.json pnpm-lock.yaml ./
 
8
 
 
 
9
  RUN corepack enable pnpm && pnpm install
10
 
11
  # Copy the rest of your app's source code
12
- COPY . .
13
 
14
  # Expose the port the app runs on
15
  EXPOSE 5173
@@ -17,7 +20,7 @@ EXPOSE 5173
17
  # Development image
18
  FROM base AS bolt-ai-development
19
 
20
- # Define the same environment variables for development
21
  ARG GROQ_API_KEY
22
  ARG HuggingFace
23
  ARG OPENAI_API_KEY
 
3
 
4
  WORKDIR /app
5
 
6
+ # Use non-root user
7
+ RUN useradd -m node && chown -R node:node /app
8
+ USER node
9
 
10
+ # Install dependencies (cached step)
11
+ COPY package.json pnpm-lock.yaml ./
12
  RUN corepack enable pnpm && pnpm install
13
 
14
  # Copy the rest of your app's source code
15
+ COPY --chown=node:node . .
16
 
17
  # Expose the port the app runs on
18
  EXPOSE 5173
 
20
  # Development image
21
  FROM base AS bolt-ai-development
22
 
23
+ # Define environment variables
24
  ARG GROQ_API_KEY
25
  ARG HuggingFace
26
  ARG OPENAI_API_KEY