Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Frontend Dockerfile (React/Vite)
FROM node:20-alpine AS builder

WORKDIR /app

ARG VITE_API_URL
ARG VITE_WS_URL
ARG VITE_API_KEY
ENV VITE_API_URL=$VITE_API_URL
ENV VITE_WS_URL=$VITE_WS_URL
ENV VITE_API_KEY=$VITE_API_KEY

COPY frontend/package*.json ./

RUN npm cache clean --force
RUN npm install

COPY frontend/ .

RUN npm run build

# Production stage
FROM nginx:alpine

COPY --from=builder /app/dist /usr/share/nginx/html

CMD ["nginx", "-g", "daemon off;"]
# --- Build stage ---
FROM node:20-alpine AS build

Expand Down
10 changes: 4 additions & 6 deletions frontend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Frontend Dev Dockerfile (React/Vite)

FROM node:20-alpine

WORKDIR /app

COPY package.json package-lock.json ./
COPY frontend/package.json .

RUN npm cache clean --force
RUN npm ci

COPY . .

EXPOSE 5173
COPY frontend/ .

CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "7777"]
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>frontend</title>
<title>CodeSCE</title>
</head>
<body>
<div id="root"></div>
Expand Down
Loading