Trudy commited on
Commit
df806fc
·
1 Parent(s): b80171e

had too much going on...

Browse files
Files changed (3) hide show
  1. Dockerfile +10 -17
  2. README.md +1 -0
  3. docker-compose.yml +3 -8
Dockerfile CHANGED
@@ -1,33 +1,26 @@
1
- # Use the official Node.js image
2
  FROM node:20
3
 
4
- # Create and change to the app directory
5
  WORKDIR /usr/src/app
6
 
7
- # Copy application dependency manifests to the container image
8
  COPY package*.json ./
9
 
10
- # Install production dependencies
11
  RUN npm install
12
 
13
  # Copy application code and environment variables
14
  COPY . .
15
 
16
- # Build the React app
17
  RUN npm run build
18
 
19
- # Install serve to properly serve the static files
20
- RUN npm install -g serve
21
-
22
- # Expose the ports the app runs on
23
- EXPOSE 3000
24
  EXPOSE 3001
25
 
26
- # Create a script to run both services
27
- RUN echo '#!/bin/bash\n\
28
- npm run start-server & \
29
- serve -s build -l 3000\n\
30
- wait' > start-services.sh && chmod +x start-services.sh
31
 
32
- # Run both services
33
- CMD ["./start-services.sh"]
 
1
+ # Use the official Node.js image with a more recent version
2
  FROM node:20
3
 
4
+ # Create and change to the app directory.
5
  WORKDIR /usr/src/app
6
 
7
+ # Copy application dependency manifests to the container image.
8
  COPY package*.json ./
9
 
10
+ # Install all dependencies (including devDependencies for build)
11
  RUN npm install
12
 
13
  # Copy application code and environment variables
14
  COPY . .
15
 
16
+ # Build the app
17
  RUN npm run build
18
 
19
+ # Expose the port the app runs on
 
 
 
 
20
  EXPOSE 3001
21
 
22
+ # Set environment variable for production
23
+ ENV NODE_ENV=production
 
 
 
24
 
25
+ # Run the server
26
+ CMD [ "npm", "run", "start-server" ]
README.md CHANGED
@@ -5,6 +5,7 @@ colorFrom: blue
5
  colorTo: purple
6
  sdk: docker
7
  pinned: false
 
8
  license: apache-2.0
9
  short_description: Gemini Multimodal Live API Console
10
  ---
 
5
  colorTo: purple
6
  sdk: docker
7
  pinned: false
8
+ app_port: 3001
9
  license: apache-2.0
10
  short_description: Gemini Multimodal Live API Console
11
  ---
docker-compose.yml CHANGED
@@ -1,14 +1,9 @@
1
  version: '3.8'
2
 
3
  services:
4
- web:
5
  build: .
6
  ports:
7
- - "3000:3000" # React frontend
8
- - "3001:3001" # Backend server
9
  environment:
10
- - NODE_ENV=production
11
- - GEMINI_API_KEY=${GEMINI_API_KEY}
12
- volumes:
13
- - .:/usr/src/app
14
- - /usr/src/app/node_modules
 
1
  version: '3.8'
2
 
3
  services:
4
+ app:
5
  build: .
6
  ports:
7
+ - "3001:3001"
 
8
  environment:
9
+ - GEMINI_API_KEY=${GEMINI_API_KEY}