Fix some for production
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
*
|
||||
!dist/
|
||||
!dist/**
|
||||
!nginx.conf
|
||||
!Dockerfile
|
||||
@@ -1,43 +1,8 @@
|
||||
FROM node:20-bookworm AS base
|
||||
FROM docker.arvancloud.ir/nginx:latest
|
||||
|
||||
# Server often cannot reach registry.npmjs.org (Cloudflare). Override in Dokploy if needed.
|
||||
ARG NPM_REGISTRY=https://mirror.kargadan.ir/repository/npm-group/
|
||||
ENV npm_config_registry=${NPM_REGISTRY}
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
# Skip corepack (it fetches pnpm from npmjs/Cloudflare). Install from mirror instead.
|
||||
# Pin major only — Iranian mirrors often lag behind exact patch versions (e.g. 2.10.12).
|
||||
RUN npm install -g pnpm@9 turbo@2 \
|
||||
&& printf 'registry=%s\n' "${NPM_REGISTRY}" > /root/.npmrc
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN turbo prune admin-panel --docker
|
||||
|
||||
FROM base AS installer
|
||||
WORKDIR /app
|
||||
# First install dependencies
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
COPY turbo.json turbo.json
|
||||
COPY tsconfig.base.json tsconfig.base.json
|
||||
# Re-link workspace after full source copy (pnpm symlinks)
|
||||
RUN pnpm install --frozen-lockfile --offline || pnpm install --frozen-lockfile
|
||||
RUN pnpm turbo run build --filter=admin-panel...
|
||||
|
||||
FROM nginx:alpine AS runner
|
||||
# Copy custom Nginx configuration
|
||||
COPY nginx-spa.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy the built files from the installer stage
|
||||
COPY --from=installer /app/apps/admin-panel/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
+30
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
header[data-v-83ac81a0]{padding:1rem;border-bottom:1px solid #ddd}main[data-v-83ac81a0]{padding:1rem}table[data-v-b7e9a99c]{width:100%;border-collapse:collapse}th[data-v-b7e9a99c],td[data-v-b7e9a99c]{text-align:left;padding:.5rem;border-bottom:1px solid #ddd}.error[data-v-b7e9a99c]{color:#b00020}table[data-v-15a1e392]{width:100%;border-collapse:collapse;margin-bottom:1rem}th[data-v-15a1e392],td[data-v-15a1e392]{text-align:left;padding:.4rem}.error[data-v-15a1e392],.error[data-v-f898fdad]{color:#b00020}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gold Bank — Admin Panel</title>
|
||||
<script type="module" crossorigin src="/assets/index-B84ZE15H.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CsChEyRN.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>␍
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg)$ {
|
||||
expires 6M;
|
||||
access_log off;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user