jan/Dockerfile
Dinh Long Nguyen d490174544
feat: Web use jan model (#6374)
* call jan api

* fix lint

* ci: add jan server web

* chore: add Dockerfile

* clean up ui ux and support for reasoning fields, make app spa

* add logo

* chore: update tag for preview image

* chore: update k8s service name

* chore: update image tag and image name

* fixed test

---------

Co-authored-by: Minh141120 <minh.itptit@gmail.com>
Co-authored-by: Nguyen Ngoc Minh <91668012+Minh141120@users.noreply.github.com>
2025-09-05 16:18:30 +07:00

48 lines
1.0 KiB
Docker

# Stage 1: Build stage with Node.js and Yarn v4
FROM node:20-alpine AS builder
# Install build dependencies
RUN apk add --no-cache \
make \
g++ \
python3 \
py3-pip \
git
# Enable corepack and install Yarn 4
RUN corepack enable && corepack prepare yarn@4.5.3 --activate
# Verify Yarn version
RUN yarn --version
# Set working directory
WORKDIR /app
# Copy source code
COPY ./extensions ./extensions
COPY ./extensions-web ./extensions-web
COPY ./web-app ./web-app
COPY ./Makefile ./Makefile
COPY ./.* /
COPY ./package.json ./package.json
COPY ./yarn.lock ./yarn.lock
COPY ./pre-install ./pre-install
COPY ./core ./core
# Build web application
RUN yarn install && yarn build:core && make build-web-app
# Stage 2: Production stage with Nginx
FROM nginx:alpine
# Copy static files from build stage
COPY --from=builder /app/web-app/dist-web /usr/share/nginx/html
# Copy nginx configuration for SPA (if custom config is needed)
# COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]