barreloflube commited on
Commit
9f84f2e
·
1 Parent(s): 104ff23

chore: Update Dockerfile and preview script for Node.js and host configuration

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -1
  2. package.json +1 -1
Dockerfile CHANGED
@@ -10,8 +10,19 @@ RUN apt-get update && apt-get install -y \
10
  git \
11
  build-essential \
12
  unzip \
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
 
 
 
 
 
 
 
 
 
15
  # Create and set working directory
16
  WORKDIR /app
17
 
@@ -40,4 +51,4 @@ RUN bun run build
40
  EXPOSE 7860
41
 
42
  # Command to run the application
43
- CMD ["bun", "run", "preview"]
 
10
  git \
11
  build-essential \
12
  unzip \
13
+ ca-certificates \
14
+ gnupg \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Install Node.js 18.x
18
+ RUN mkdir -p /etc/apt/keyrings && \
19
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
20
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
21
+ apt-get update && \
22
+ apt-get install -y nodejs && \
23
+ rm -rf /var/lib/apt/lists/* && \
24
+ node -v && npm -v
25
+
26
  # Create and set working directory
27
  WORKDIR /app
28
 
 
51
  EXPOSE 7860
52
 
53
  # Command to run the application
54
+ CMD bun run preview
package.json CHANGED
@@ -7,7 +7,7 @@
7
  "dev": "vite",
8
  "build": "tsc -b && vite build",
9
  "lint": "eslint .",
10
- "preview": "vite preview",
11
  "predeploy": "bun run build",
12
  "deploy": "bun run build && npx wrangler pages deploy dist"
13
  },
 
7
  "dev": "vite",
8
  "build": "tsc -b && vite build",
9
  "lint": "eslint .",
10
+ "preview": "vite preview --host",
11
  "predeploy": "bun run build",
12
  "deploy": "bun run build && npx wrangler pages deploy dist"
13
  },