46 lines
1.5 KiB
Docker
46 lines
1.5 KiB
Docker
# AyaNova v8 Frontend Build Environment
|
|
#
|
|
# This Dockerfile creates a reproducible build environment for the Vue.js frontend.
|
|
# It uses the exact Node.js version (12.22.9) that the project was developed with.
|
|
#
|
|
# Usage:
|
|
# Build the image:
|
|
# docker build -f Dockerfile.frontend -t ayanova-frontend-build .
|
|
#
|
|
# Run a build (mount your source code):
|
|
# docker run --rm -v "c:/data/code/raven-client/ayanova:/app" -v "c:/data/code/raven/server/AyaNova/wwwroot:/output" ayanova-frontend-build
|
|
#
|
|
# Interactive shell for debugging:
|
|
# docker run --rm -it -v "c:/data/code/raven-client/ayanova:/app" ayanova-frontend-build /bin/bash
|
|
#
|
|
|
|
FROM node:12.22.9-bullseye
|
|
|
|
# Install build tools needed for native modules (fibers)
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files first (for better layer caching)
|
|
# When running with volume mounts, these will be overwritten
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
# Using --legacy-peer-deps because some packages have outdated peer dependencies
|
|
RUN npm ci --legacy-peer-deps || npm install --legacy-peer-deps
|
|
|
|
# Copy the rest of the source code
|
|
# (This layer is skipped when using volume mounts)
|
|
COPY . .
|
|
|
|
# Default command: run the production build
|
|
CMD ["npm", "run", "build"]
|
|
|
|
# To copy output to host, the build script or docker run command should handle it
|
|
# Example: docker run ... && docker cp container:/app/dist ./dist
|