remove user-secrets approach & prepare a pilot deploy
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
node_modules
|
||||
.next
|
||||
out
|
||||
coverage
|
||||
.swc
|
||||
graphify-out
|
||||
*.tsbuildinfo
|
||||
|
||||
# Local-only env files — .env.production IS copied, it is the deployed build's input.
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
CLAUDE.md
|
||||
AGENTS.md
|
||||
README.md
|
||||
@@ -0,0 +1,24 @@
|
||||
# Deployed (balinyaar.ir) values, read by `next build` when NODE_ENV=production.
|
||||
#
|
||||
# Every NEXT_PUBLIC_* value here is INLINED INTO THE CLIENT BUNDLE AT BUILD TIME — it is public by
|
||||
# definition, and changing one requires rebuilding the image, not restarting the container.
|
||||
# `.env.development` still owns the local `npm run dev` loop and is untouched by this file.
|
||||
|
||||
# Enables analytics and public resources.
|
||||
NEXT_PUBLIC_ENV = production
|
||||
|
||||
# Off in a deployed build — `true` prints the resolved @/config (incl. the API URL) to the browser console.
|
||||
NEXT_PUBLIC_DEBUG = false
|
||||
|
||||
# Public origin of the web app.
|
||||
NEXT_PUBLIC_PUBLIC_URL = https://balinyaar.ir
|
||||
|
||||
# Absolute origin used only for metadata (OG tags, metadataBase, robots.ts, sitemap.ts) — never for API calls.
|
||||
NEXT_PUBLIC_SITE_URL = https://balinyaar.ir
|
||||
|
||||
# The API, reached from the BROWSER — so it is the public hostname Caddy serves, never the container name.
|
||||
NEXT_PUBLIC_API_URL = https://api.balinyaar.ir
|
||||
|
||||
# Neshan **web** key (client-embeddable maps/search) from https://platform.neshan.org. Unset: the address
|
||||
# map-pin picker falls back to its bounded-canvas grid stand-in. Rebuild the client image after setting it.
|
||||
# NEXT_PUBLIC_NESHAN_KEY = your-neshan-web-key
|
||||
@@ -0,0 +1,36 @@
|
||||
# Balinyaar web client — build context is `client/` (see the root docker-compose.yml).
|
||||
#
|
||||
# NEXT_PUBLIC_* values are inlined into the browser bundle by `next build`, so the API URL and site origin
|
||||
# are BUILD-time inputs, not runtime env vars — setting them in compose would do nothing. They come from the
|
||||
# committed .env.production, which `next build` reads because it runs with NODE_ENV=production; change a value
|
||||
# there and rebuild the image.
|
||||
|
||||
FROM node:22-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine AS final
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
# `output: 'standalone'` traces the runtime dependencies into .next/standalone; static assets and public/
|
||||
# are deliberately NOT included in that trace and must be copied alongside it, or every asset 404s.
|
||||
COPY --from=build --chown=node:node /app/.next/standalone ./
|
||||
COPY --from=build --chown=node:node /app/.next/static ./.next/static
|
||||
COPY --from=build --chown=node:node /app/public ./public
|
||||
|
||||
USER node
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server.js"]
|
||||
@@ -7,7 +7,10 @@ const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
turbopack: {
|
||||
root: '.'
|
||||
}
|
||||
},
|
||||
// Emits .next/standalone — a self-contained server bundling only the traced runtime dependencies, so
|
||||
// the Docker image carries no node_modules tree. Harmless for `npm run dev`/`npm run build` locally.
|
||||
output: 'standalone'
|
||||
};
|
||||
|
||||
export default withNextIntl(nextConfig);
|
||||
|
||||
Reference in New Issue
Block a user