File size: 537 Bytes
9fed9f2
 
 
 
 
 
 
 
 
 
 
 
 
25161d8
c12d893
 
9fed9f2
25161d8
 
 
9fed9f2
 
 
 
 
 
 
 
 
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
FROM node:16-slim

WORKDIR /app

# Copy package files
COPY package*.json ./
RUN npm install

# Copy source files
COPY public/ ./public/
COPY src/ ./src/
COPY tsconfig.json ./

# Set environment variable
ARG REACT_APP_GEMINI_API_KEY
ENV REACT_APP_GEMINI_API_KEY=$REACT_APP_GEMINI_API_KEY

# Create .env file explicitly
RUN echo "REACT_APP_GEMINI_API_KEY=$REACT_APP_GEMINI_API_KEY" > .env

# Build the application
RUN npm run build

# Install serve globally
RUN npm install -g serve

EXPOSE 3000

CMD ["serve", "-s", "build", "-p", "3000"]