45 lines
1.1 KiB
Docker
45 lines
1.1 KiB
Docker
FROM node:20 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
# Copy root package files
|
|
COPY package.json package-lock.json ./
|
|
|
|
# Copy workspace package.json files to ensure npm ci works correctly in monorepo
|
|
COPY packages/backend/package.json ./packages/backend/
|
|
COPY packages/frontend/package.json ./packages/frontend/
|
|
COPY packages/remote-gateway/package.json ./packages/remote-gateway/
|
|
|
|
# Install dependencies (using install instead of ci for potential armv7 compatibility issues)
|
|
RUN npm install
|
|
|
|
|
|
COPY packages/frontend/src ./packages/frontend/src
|
|
COPY packages/frontend/index.html ./packages/frontend/
|
|
COPY packages/frontend/tsconfig.json ./packages/frontend/
|
|
COPY packages/frontend/vite.config.ts ./packages/frontend/
|
|
|
|
|
|
# Copy the root .env file into the builder stage so Vite can read it during build
|
|
COPY .env ./.env
|
|
|
|
RUN npm run build --workspace=@nexus-terminal/frontend
|
|
|
|
|
|
FROM nginx:stable-alpine
|
|
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
|
|
COPY --from=builder /app/packages/frontend/dist /usr/share/nginx/html
|
|
|
|
|
|
COPY packages/frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |