Skip to content

Commit dcad700

Browse files
committed
expose port
1 parent d3d2fd4 commit dcad700

File tree

3 files changed

+66
-59
lines changed

3 files changed

+66
-59
lines changed

Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
# Use a minimal Node.js image
12
FROM node:18-alpine
23

4+
# Set working directory
35
WORKDIR /app
46

5-
COPY package.json package-lock.json ./
6-
7-
# Remove problematic dependencies and force a fresh install
8-
RUN rm -rf node_modules package-lock.json && \
9-
npm cache clean --force && \
10-
npm install --force
7+
# Copy package.json and install dependencies
8+
COPY package*.json ./
9+
RUN npm install --force
1110

11+
# Copy the entire application
1212
COPY . .
1313

14+
# Build the frontend
15+
RUN npm run build
16+
17+
# Expose a port (Render provides it dynamically)
1418
EXPOSE 5173
15-
ENV PORT=5173
19+
20+
# Ensure the correct host and port are set
1621
ENV HOST=0.0.0.0
22+
ENV BASE_PATH=/deepgit
1723

18-
CMD ["npm", "start"]
24+
# Render assigns a PORT dynamically, so we use it
25+
CMD ["sh", "-c", "npm start -- --port $PORT --host 0.0.0.0"]

package-lock.json

Lines changed: 50 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "deepgit",
33
"version": "1.0.0-beta.4",
44
"scripts": {
5-
"start": "vite preview --port 5173 --host",
5+
"start": "vite preview --port 5173 --host 0.0.0.0",
66
"build": "vite build",
77
"test": "vitest",
88
"clean": "prettier --write src",

0 commit comments

Comments
 (0)