bolto90 commited on
Commit
0ef3096
·
1 Parent(s): 50a501e

Docker Additions

Browse files

Added Dockerfile and docker-compose.yml, also adjusted start command to listen for all IP's and on Port 3000

Files changed (3) hide show
  1. Dockerfile +29 -0
  2. docker-compose.yml +23 -0
  3. package.json +1 -1
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Node.js runtime as the base image
2
+ FROM node:20.15.1
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install pnpm
8
+ RUN npm install -g [email protected]
9
+
10
+ # Copy package.json and pnpm-lock.yaml (if available)
11
+ COPY package.json pnpm-lock.yaml* ./
12
+
13
+ # Install dependencies
14
+ RUN pnpm install
15
+
16
+ # Copy the rest of the application code
17
+ COPY . .
18
+
19
+ # Build the application
20
+ RUN pnpm run build
21
+
22
+ # Make sure bindings.sh is executable
23
+ RUN chmod +x bindings.sh
24
+
25
+ # Expose the port the app runs on (adjust if you specified a different port)
26
+ EXPOSE 3000
27
+
28
+ # Start the application
29
+ CMD ["pnpm", "run", "start"]
docker-compose.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ bolt-app:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ ports:
7
+ - "3000:3000"
8
+ environment:
9
+ - NODE_ENV=production
10
+ # Add any other environment variables your app needs
11
+ # - OPENAI_API_KEY=${OPENAI_API_KEY}
12
+ # - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
13
+ # - GROQ_API_KEY=${GROQ_API_KEY}
14
+ volumes:
15
+ # This volume is for development purposes, allowing live code updates
16
+ # Comment out or remove for production
17
+ - .:/app
18
+ # This volume is to prevent node_modules from being overwritten by the above volume
19
+ - /app/node_modules
20
+ command: pnpm run start
21
+
22
+ volumes:
23
+ node_modules:
package.json CHANGED
@@ -14,7 +14,7 @@
14
  "test:watch": "vitest",
15
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
16
  "lint:fix": "npm run lint -- --fix",
17
- "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
18
  "typecheck": "tsc",
19
  "typegen": "wrangler types",
20
  "preview": "pnpm run build && pnpm run start"
 
14
  "test:watch": "vitest",
15
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
16
  "lint:fix": "npm run lint -- --fix",
17
+ "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 3000",
18
  "typecheck": "tsc",
19
  "typegen": "wrangler types",
20
  "preview": "pnpm run build && pnpm run start"