Cole Medin commited on
Commit
47a7932
·
unverified ·
2 Parent(s): 69aceea 9ca017c

Merge pull request #23 from aaronbolton/main

Browse files
.github/workflows/github-build-push.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push Container
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ # paths:
8
+ # - 'Dockerfile'
9
+ workflow_dispatch:
10
+ jobs:
11
+ build-and-push:
12
+ runs-on: [ubuntu-latest]
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up QEMU
18
+ uses: docker/setup-qemu-action@v1
19
+
20
+ - name: Set up Docker Buildx
21
+ uses: docker/setup-buildx-action@v1
22
+
23
+ - name: Login to GitHub Container Registry
24
+ uses: docker/login-action@v1
25
+ with:
26
+ registry: ghcr.io
27
+ username: ${{ github.actor }}
28
+ password: ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name: Build and Push Containers
31
+ uses: docker/build-push-action@v2
32
+ with:
33
+ context: .
34
+ file: Dockerfile
35
+ platforms: linux/amd64,linux/arm64
36
+ push: true
37
+ tags: |
38
+ ghcr.io/${{ github.repository }}:latest
39
+ ghcr.io/${{ github.repository }}:${{ github.sha }}
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,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
15
+ volumes:
16
+ # This volume is for development purposes, allowing live code updates
17
+ # Comment out or remove for production
18
+ - .:/app
19
+ # This volume is to prevent node_modules from being overwritten by the above volume
20
+ - /app/node_modules
21
+ command: pnpm run start
22
+
23
+ volumes:
24
+ 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"