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
4 changes: 3 additions & 1 deletion deployment/docker-compose-azure.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
services:
frontend:
build: ../frontend
build:
context: ../frontend
target: production
environment:
- VITE_API_HOST=http://localhost:7091
- VITE_API_STREAMING=$VITE_API_STREAMING
Expand Down
8 changes: 5 additions & 3 deletions deployment/docker-compose-local.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
services:
frontend:
build: ../frontend
build:
context: ../frontend
target: development
volumes:
- ../frontend/src:/app/src
- ../frontend/src:/app/src
environment:
- VITE_API_HOST=http://localhost:7091
- VITE_API_STREAMING=$VITE_API_STREAMING
Expand All @@ -26,7 +28,7 @@ services:
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U docsgpt -d docsgpt"]
test: [ "CMD-SHELL", "pg_isready -U docsgpt -d docsgpt" ]
interval: 5s
timeout: 5s
retries: 10
Expand Down
4 changes: 3 additions & 1 deletion deployment/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: docsgpt-oss
services:
frontend:
build: ../frontend
build:
context: ../frontend
target: development
volumes:
- ../frontend/src:/app/src
environment:
Expand Down
5 changes: 5 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.git
Dockerfile
.dockerignore
29 changes: 25 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
FROM node:22-bullseye-slim

FROM node:22-alpine AS base

WORKDIR /app

COPY package*.json ./
RUN npm install

RUN npm ci

COPY . .

FROM base AS development

# start the development server of Vite
CMD ["npm", "run", "dev", "--", "--host"]


FROM base AS build

# build the application for production
RUN npm run build


FROM nginx:alpine AS production

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

COPY nginx.conf /etc/nginx/conf.d/default.conf
Comment on lines +23 to +27

# serving on port 5173 to match the Vite development server port, making it compatible with existing setup
EXPOSE 5173

CMD [ "npm", "run", "dev", "--" , "--host"]
CMD ["nginx", "-g", "daemon off;"]
15 changes: 15 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 5173;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}

location /assets/ {
root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public, no-transform";
}
}
Loading