feat/role-check: wip

This commit is contained in:
2025-12-11 10:11:58 +07:00
parent ee06f42c06
commit 9bf7dacf55
4 changed files with 51 additions and 21 deletions
+33
View File
@@ -0,0 +1,33 @@
# Build Stage
FROM node:20-alpine AS build-stage
# Set the working directory inside the container
WORKDIR /app
# Enable pnpm using corepack
RUN corepack enable
# Copy pnpm related files and package.json to leverage Docker layer caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies using pnpm
# Using --frozen-lockfile ensures consistent installations based on pnpm-lock.yaml
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store pnpm install --frozen-lockfile
# Copy the rest of the application files
COPY . .
# Build the Vue.js application for production
RUN pnpm build
# Production Stage
FROM nginx:stable-alpine AS production-stage
# Copy the built Vue.js application from the build stage to Nginx's web root
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Expose port 80 for Nginx
EXPOSE 80
# Command to run Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]