mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat: add Dockerfiles for backend, frontend, and worker services with CI/CD pipeline configuration
This commit is contained in:
35
front/Dockerfile
Normal file
35
front/Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN corepack enable pnpm && pnpm i
|
||||
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN corepack enable pnpm && pnpm i && pnpm build
|
||||
|
||||
FROM base AS runner
|
||||
ARG BUILD_TAG
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache curl openssl
|
||||
ENV NODE_ENV production
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nuxtjs
|
||||
|
||||
# Only `.output` folder is needed from the build stage
|
||||
COPY --from=builder --chown=nuxtjs:nodejs /app/.output/ ./
|
||||
|
||||
# Change the port and host
|
||||
ENV PORT 80
|
||||
ENV HOST 0.0.0.0
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["node", "/app/server/index.mjs"]
|
||||
Reference in New Issue
Block a user