dev: hotfix, dockerize

This commit is contained in:
2025-12-16 19:56:49 +07:00
parent 00f271524f
commit ee56ad39a6
3 changed files with 8387 additions and 9354 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
node_modules
.git
.gitignore
*.md
dist

View File

@@ -1,17 +1,28 @@
# Build stage
FROM node:20-alpine AS build-stage
# syntax = docker/dockerfile:1
# --- Build Stage ---
FROM node:20-alpine AS build
WORKDIR /app
RUN corepack enable
# Copy package.json and lock file, then install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
# Copy the rest of the application code and build
COPY . .
RUN pnpm build
# --- Production Stage ---
FROM node:20-alpine AS prod
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Only copy the built output from the build stage
COPY --from=build /app/.output ./
COPY . .
RUN pnpm generate
# Set environment variables for the server
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE $PORT
# Production stage
FROM nginx:stable-alpine
COPY --from=build-stage /app/.output/public /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# Start the application
CMD ["node", "server/index.mjs"]

17698
pnpm-lock.yaml generated
View File

File diff suppressed because it is too large Load Diff