chore: add node docker service for vite dev server and prod build
This commit is contained in:
24
docker/node/Dockerfile
Normal file
24
docker/node/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
###
|
||||
# Dev stage
|
||||
###
|
||||
FROM base AS dev
|
||||
|
||||
# Dependencies are mounted via volume, install at startup
|
||||
CMD ["sh", "-c", "npm install && npx vite"]
|
||||
|
||||
###
|
||||
# Build stage (used by app prod image)
|
||||
###
|
||||
FROM base AS build
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install
|
||||
|
||||
COPY assets/ ./assets/
|
||||
COPY vite.config.js ./
|
||||
|
||||
RUN npm run build
|
||||
Reference in New Issue
Block a user