Charan5775 commited on
Commit
816d0c6
·
verified ·
1 Parent(s): 1390ce5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -14
Dockerfile CHANGED
@@ -3,21 +3,16 @@ FROM ${BASE} AS base
3
 
4
  WORKDIR /app
5
 
6
- # Install pnpm (preferred: corepack, fallback: npm)
7
- RUN corepack prepare [email protected] --activate || npm install -g [email protected]
8
-
9
- # Change ownership of the /app directory to the node user
10
- RUN chown -R node:node /app
11
-
12
- # Switch to the node user
13
- USER node
14
-
15
- # Install dependencies
16
  COPY package.json pnpm-lock.yaml ./
17
- RUN pnpm install
 
18
 
19
  # Copy the rest of your app's source code
20
- COPY --chown=node:node . .
 
 
 
21
 
22
  # Expose the port the app runs on
23
  EXPOSE 5173
@@ -25,7 +20,7 @@ EXPOSE 5173
25
  # Development image
26
  FROM base AS bolt-ai-development
27
 
28
- # Define environment variables
29
  ARG GROQ_API_KEY
30
  ARG HuggingFace
31
  ARG OPENAI_API_KEY
@@ -50,5 +45,8 @@ ENV GROQ_API_KEY=${GROQ_API_KEY} \
50
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
51
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
52
 
53
- RUN mkdir -p ${WORKDIR}/run
 
 
 
54
  CMD pnpm run dev --host
 
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
+ # Ensure correct permissions for the /app directory
15
+ RUN chmod -R 755 /app
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 the same environment variables for development
24
  ARG GROQ_API_KEY
25
  ARG HuggingFace
26
  ARG OPENAI_API_KEY
 
45
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
46
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
47
 
48
+ # Ensure correct permissions for the /app directory again in case of any issue during COPY
49
+ RUN chmod -R 755 /app
50
+
51
+ # Run the development server
52
  CMD pnpm run dev --host