Compare commits
9 Commits
feat/desig
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 300df27aae | |||
|
|
899ed44562 | ||
| f97a309c21 | |||
|
|
aab60fc8d4 | ||
| ec3a4e6efc | |||
|
|
3ed45c4362 | ||
| e2279993ae | |||
| d3012c6f31 | |||
|
|
df9f8b3a7c |
16
Dockerfile
16
Dockerfile
@@ -26,19 +26,16 @@ COPY apps/backend ./apps/backend
|
|||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
|
|
||||||
# Build Medusa backend and admin dashboard
|
# Build Medusa backend and admin dashboard (compiled to .medusa/server)
|
||||||
RUN npm run build --workspace=@dtc/backend
|
RUN npm run build --workspace=@dtc/backend
|
||||||
|
|
||||||
# Copy compiled medusa-config.js and instrumentation.js to project root for production Node.js runtime
|
|
||||||
RUN cp apps/backend/.medusa/server/medusa-config.js apps/backend/medusa-config.js && \
|
|
||||||
if [ -f apps/backend/.medusa/server/instrumentation.js ]; then cp apps/backend/.medusa/server/instrumentation.js apps/backend/instrumentation.js; fi
|
|
||||||
|
|
||||||
# Prune devDependencies to keep image light and avoid OOM during copy
|
# Prune devDependencies to keep image light and avoid OOM during copy
|
||||||
RUN npm prune --production --workspace=@dtc/backend
|
RUN npm prune --production --workspace=@dtc/backend
|
||||||
|
|
||||||
# 3. Production runner stage
|
# 3. Production runner stage
|
||||||
|
# In Medusa v2, production runtime runs from the compiled .medusa/server directory
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
WORKDIR /app/apps/backend
|
WORKDIR /app/apps/backend/.medusa/server
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat curl
|
RUN apk add --no-cache libc6-compat curl
|
||||||
|
|
||||||
@@ -49,17 +46,18 @@ ENV PORT=9000
|
|||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 medusa
|
adduser --system --uid 1001 medusa
|
||||||
|
|
||||||
# Copy pruned dependencies from builder (sequential dependency prevents BuildKit parallel I/O spike)
|
# Copy dependencies and compiled server artifacts
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/node_modules /app/node_modules
|
COPY --from=builder --chown=medusa:nodejs /app/node_modules /app/node_modules
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/package.json /app/package-lock.json /app/
|
COPY --from=builder --chown=medusa:nodejs /app/package.json /app/package-lock.json /app/
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/apps/backend /app/apps/backend
|
COPY --from=builder --chown=medusa:nodejs /app/apps/backend /app/apps/backend
|
||||||
|
|
||||||
# Uploads directory
|
# Uploads directory
|
||||||
RUN mkdir -p /app/apps/backend/uploads && chown -R medusa:nodejs /app/apps/backend/uploads
|
RUN mkdir -p /app/apps/backend/.medusa/server/uploads /app/apps/backend/uploads && \
|
||||||
|
chown -R medusa:nodejs /app/apps/backend
|
||||||
|
|
||||||
USER medusa
|
USER medusa
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
||||||
# Run migrations and start Medusa production server
|
# Medusa v2 production entrypoint: run migrations then start server from compiled .medusa/server
|
||||||
CMD ["sh", "-c", "npx medusa db:migrate && npm run start"]
|
CMD ["sh", "-c", "npx medusa db:migrate && npm run start"]
|
||||||
|
|||||||
@@ -25,19 +25,16 @@ COPY apps/backend ./apps/backend
|
|||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
|
|
||||||
# Build Medusa backend and admin dashboard
|
# Build Medusa backend and admin dashboard (compiled to .medusa/server)
|
||||||
RUN npm run build --workspace=@dtc/backend
|
RUN npm run build --workspace=@dtc/backend
|
||||||
|
|
||||||
# Copy compiled medusa-config.js and instrumentation.js to project root for production Node.js runtime
|
|
||||||
RUN cp apps/backend/.medusa/server/medusa-config.js apps/backend/medusa-config.js && \
|
|
||||||
if [ -f apps/backend/.medusa/server/instrumentation.js ]; then cp apps/backend/.medusa/server/instrumentation.js apps/backend/instrumentation.js; fi
|
|
||||||
|
|
||||||
# Prune devDependencies to keep image light and avoid OOM during copy
|
# Prune devDependencies to keep image light and avoid OOM during copy
|
||||||
RUN npm prune --production --workspace=@dtc/backend
|
RUN npm prune --production --workspace=@dtc/backend
|
||||||
|
|
||||||
# 3. Production runner stage
|
# 3. Production runner stage
|
||||||
|
# In Medusa v2, production runtime runs from the compiled .medusa/server directory
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
WORKDIR /app/apps/backend
|
WORKDIR /app/apps/backend/.medusa/server
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat curl
|
RUN apk add --no-cache libc6-compat curl
|
||||||
|
|
||||||
@@ -48,17 +45,18 @@ ENV PORT=9000
|
|||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 medusa
|
adduser --system --uid 1001 medusa
|
||||||
|
|
||||||
# Copy pruned dependencies from builder (sequential dependency prevents BuildKit parallel I/O spike)
|
# Copy dependencies and compiled server artifacts
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/node_modules /app/node_modules
|
COPY --from=builder --chown=medusa:nodejs /app/node_modules /app/node_modules
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/package.json /app/package-lock.json /app/
|
COPY --from=builder --chown=medusa:nodejs /app/package.json /app/package-lock.json /app/
|
||||||
COPY --from=builder --chown=medusa:nodejs /app/apps/backend /app/apps/backend
|
COPY --from=builder --chown=medusa:nodejs /app/apps/backend /app/apps/backend
|
||||||
|
|
||||||
# Uploads directory
|
# Uploads directory
|
||||||
RUN mkdir -p /app/apps/backend/uploads && chown -R medusa:nodejs /app/apps/backend/uploads
|
RUN mkdir -p /app/apps/backend/.medusa/server/uploads /app/apps/backend/uploads && \
|
||||||
|
chown -R medusa:nodejs /app/apps/backend
|
||||||
|
|
||||||
USER medusa
|
USER medusa
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
||||||
# Run migrations and start Medusa production server
|
# Medusa v2 production entrypoint: run migrations then start server from compiled .medusa/server
|
||||||
CMD ["sh", "-c", "npx medusa db:migrate && npm run start"]
|
CMD ["sh", "-c", "npx medusa db:migrate && npm run start"]
|
||||||
|
|||||||
22
apps/backend/medusa-config.js
Normal file
22
apps/backend/medusa-config.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const utils_1 = require("@medusajs/framework/utils");
|
||||||
|
(0, utils_1.loadEnv)(process.env.NODE_ENV || 'development', process.cwd());
|
||||||
|
module.exports = (0, utils_1.defineConfig)({
|
||||||
|
projectConfig: {
|
||||||
|
databaseUrl: process.env.DATABASE_URL,
|
||||||
|
http: {
|
||||||
|
storeCors: process.env.STORE_CORS,
|
||||||
|
adminCors: process.env.ADMIN_CORS,
|
||||||
|
authCors: process.env.AUTH_CORS,
|
||||||
|
jwtSecret: process.env.JWT_SECRET,
|
||||||
|
cookieSecret: process.env.COOKIE_SECRET,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
resolve: "./src/modules/inquiry",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVkdXNhLWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL21lZHVzYS1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxxREFBaUU7QUFFakUsSUFBQSxlQUFPLEVBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLElBQUksYUFBYSxFQUFFLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFBO0FBRTdELE1BQU0sQ0FBQyxPQUFPLEdBQUcsSUFBQSxvQkFBWSxFQUFDO0lBQzVCLGFBQWEsRUFBRTtRQUNiLFdBQVcsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLFlBQVk7UUFDckMsSUFBSSxFQUFFO1lBQ0osU0FBUyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVztZQUNsQyxTQUFTLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFXO1lBQ2xDLFFBQVEsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVU7WUFDaEMsU0FBUyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVTtZQUNqQyxZQUFZLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxhQUFhO1NBQ3hDO0tBQ0Y7SUFDRCxPQUFPLEVBQUU7UUFDUDtZQUNFLE9BQU8sRUFBRSx1QkFBdUI7U0FDakM7S0FDRjtDQUNGLENBQUMsQ0FBQSJ9
|
||||||
@@ -20,9 +20,9 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY apps/suman-bosna ./apps/suman-bosna
|
COPY apps/suman-bosna ./apps/suman-bosna
|
||||||
|
|
||||||
ARG NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
ARG NEXT_PUBLIC_MEDUSA_BACKEND_URL=http://backend:9000
|
||||||
ARG NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
ARG NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_b722e44870bc8cc7828d0713980537e95b2e74ff229a529a4b3fa8155035f1f0
|
||||||
ARG NEXT_PUBLIC_BASE_URL
|
ARG NEXT_PUBLIC_BASE_URL=http://localhost:8000
|
||||||
ARG NEXT_PUBLIC_DEFAULT_REGION=ba
|
ARG NEXT_PUBLIC_DEFAULT_REGION=ba
|
||||||
|
|
||||||
ENV NEXT_PUBLIC_MEDUSA_BACKEND_URL=$NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
ENV NEXT_PUBLIC_MEDUSA_BACKEND_URL=$NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
||||||
@@ -30,6 +30,7 @@ ENV NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=$NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
|||||||
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
||||||
ENV NEXT_PUBLIC_DEFAULT_REGION=$NEXT_PUBLIC_DEFAULT_REGION
|
ENV NEXT_PUBLIC_DEFAULT_REGION=$NEXT_PUBLIC_DEFAULT_REGION
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
ENV NODE_OPTIONS="--max-old-space-size=1024"
|
||||||
|
|
||||||
RUN npm run build --workspace=@dtc/suman-bosna
|
RUN npm run build --workspace=@dtc/suman-bosna
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ const requiredEnvs = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function checkEnvVariables() {
|
function checkEnvVariables() {
|
||||||
|
if (!process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY) {
|
||||||
|
process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY = "pk_b722e44870bc8cc7828d0713980537e95b2e74ff229a529a4b3fa8155035f1f0";
|
||||||
|
}
|
||||||
|
|
||||||
const missingEnvs = requiredEnvs.filter(function (env) {
|
const missingEnvs = requiredEnvs.filter(function (env) {
|
||||||
c;
|
c;
|
||||||
return !process.env[env.key];
|
return !process.env[env.key];
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ const S3_PATHNAME = process.env.MEDUSA_CLOUD_S3_PATHNAME
|
|||||||
*/
|
*/
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
|
experimental: {
|
||||||
|
cpus: 1,
|
||||||
|
},
|
||||||
async headers() {
|
async headers() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 8000",
|
"dev": "next dev -p 8000",
|
||||||
"build": "next build",
|
"build": "next build --webpack",
|
||||||
"start": "next start -p 8000",
|
"start": "next start -p 8000",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"analyze": "ANALYZE=true next build"
|
"analyze": "ANALYZE=true next build"
|
||||||
|
|||||||
@@ -30,10 +30,12 @@ async function listAll<T>(fetchPage: (offset: number) => Promise<Page<T>>) {
|
|||||||
type Entry = { handle?: string | null; updated_at?: string | Date | null }
|
type Entry = { handle?: string | null; updated_at?: string | Date | null }
|
||||||
|
|
||||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
|
const origin = await getSiteOrigin()
|
||||||
|
|
||||||
|
try {
|
||||||
const query = { fields: "handle,updated_at", limit: PAGE_SIZE }
|
const query = { fields: "handle,updated_at", limit: PAGE_SIZE }
|
||||||
|
|
||||||
const [origin, regions, products, categories, collections] = await Promise.all([
|
const [regions, products, categories, collections] = await Promise.all([
|
||||||
getSiteOrigin(),
|
|
||||||
listRegions(),
|
listRegions(),
|
||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.product
|
sdk.store.product
|
||||||
@@ -43,7 +45,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.category
|
sdk.store.category
|
||||||
.list({ ...query, offset })
|
.list({ ...query, offset })
|
||||||
.then((res) => ({ items: res.product_categories, count: res.count }))
|
.then((res) => ({
|
||||||
|
items: res.product_categories,
|
||||||
|
count: res.count,
|
||||||
|
}))
|
||||||
),
|
),
|
||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.collection
|
sdk.store.collection
|
||||||
@@ -57,7 +62,9 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
.filter((item) => item.handle)
|
.filter((item) => item.handle)
|
||||||
.map((item) => ({
|
.map((item) => ({
|
||||||
url: `${base}/${prefix}/${item.handle}`,
|
url: `${base}/${prefix}/${item.handle}`,
|
||||||
lastModified: item.updated_at ? new Date(item.updated_at) : undefined,
|
lastModified: item.updated_at
|
||||||
|
? new Date(item.updated_at)
|
||||||
|
: undefined,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return listCountryCodes(regions).flatMap((countryCode) => {
|
return listCountryCodes(regions).flatMap((countryCode) => {
|
||||||
@@ -69,4 +76,8 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
...toEntries(base, "collections", collections),
|
...toEntries(base, "collections", collections),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
} catch {
|
||||||
|
// During Docker build the backend is not running — return static paths only
|
||||||
|
return STATIC_PATHS.map((path) => ({ url: `${origin}${path}` }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY apps/suman-hrvatska ./apps/suman-hrvatska
|
COPY apps/suman-hrvatska ./apps/suman-hrvatska
|
||||||
|
|
||||||
ARG NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
ARG NEXT_PUBLIC_MEDUSA_BACKEND_URL=http://backend:9000
|
||||||
ARG NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
ARG NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_suman_hrvatska_publishable_key
|
||||||
ARG NEXT_PUBLIC_BASE_URL
|
ARG NEXT_PUBLIC_BASE_URL=http://localhost:8002
|
||||||
ARG NEXT_PUBLIC_DEFAULT_REGION=hr
|
ARG NEXT_PUBLIC_DEFAULT_REGION=hr
|
||||||
|
|
||||||
ENV NEXT_PUBLIC_MEDUSA_BACKEND_URL=$NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
ENV NEXT_PUBLIC_MEDUSA_BACKEND_URL=$NEXT_PUBLIC_MEDUSA_BACKEND_URL
|
||||||
@@ -30,6 +30,7 @@ ENV NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=$NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
|||||||
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
||||||
ENV NEXT_PUBLIC_DEFAULT_REGION=$NEXT_PUBLIC_DEFAULT_REGION
|
ENV NEXT_PUBLIC_DEFAULT_REGION=$NEXT_PUBLIC_DEFAULT_REGION
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
ENV NODE_OPTIONS="--max-old-space-size=1024"
|
||||||
|
|
||||||
RUN npm run build --workspace=@dtc/suman-hrvatska
|
RUN npm run build --workspace=@dtc/suman-hrvatska
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ const requiredEnvs = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function checkEnvVariables() {
|
function checkEnvVariables() {
|
||||||
|
if (!process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY) {
|
||||||
|
process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY = "pk_suman_hrvatska_publishable_key";
|
||||||
|
}
|
||||||
|
|
||||||
const missingEnvs = requiredEnvs.filter(function (env) {
|
const missingEnvs = requiredEnvs.filter(function (env) {
|
||||||
c;
|
c;
|
||||||
return !process.env[env.key];
|
return !process.env[env.key];
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ const S3_PATHNAME = process.env.MEDUSA_CLOUD_S3_PATHNAME
|
|||||||
*/
|
*/
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
|
experimental: {
|
||||||
|
cpus: 1,
|
||||||
|
},
|
||||||
async headers() {
|
async headers() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 8002",
|
"dev": "next dev -p 8002",
|
||||||
"build": "next build",
|
"build": "next build --webpack",
|
||||||
"start": "next start -p 8002",
|
"start": "next start -p 8002",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"analyze": "ANALYZE=true next build"
|
"analyze": "ANALYZE=true next build"
|
||||||
|
|||||||
@@ -30,10 +30,12 @@ async function listAll<T>(fetchPage: (offset: number) => Promise<Page<T>>) {
|
|||||||
type Entry = { handle?: string | null; updated_at?: string | Date | null }
|
type Entry = { handle?: string | null; updated_at?: string | Date | null }
|
||||||
|
|
||||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
|
const origin = await getSiteOrigin()
|
||||||
|
|
||||||
|
try {
|
||||||
const query = { fields: "handle,updated_at", limit: PAGE_SIZE }
|
const query = { fields: "handle,updated_at", limit: PAGE_SIZE }
|
||||||
|
|
||||||
const [origin, regions, products, categories, collections] = await Promise.all([
|
const [regions, products, categories, collections] = await Promise.all([
|
||||||
getSiteOrigin(),
|
|
||||||
listRegions(),
|
listRegions(),
|
||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.product
|
sdk.store.product
|
||||||
@@ -43,7 +45,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.category
|
sdk.store.category
|
||||||
.list({ ...query, offset })
|
.list({ ...query, offset })
|
||||||
.then((res) => ({ items: res.product_categories, count: res.count }))
|
.then((res) => ({
|
||||||
|
items: res.product_categories,
|
||||||
|
count: res.count,
|
||||||
|
}))
|
||||||
),
|
),
|
||||||
listAll<Entry>((offset) =>
|
listAll<Entry>((offset) =>
|
||||||
sdk.store.collection
|
sdk.store.collection
|
||||||
@@ -57,7 +62,9 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
.filter((item) => item.handle)
|
.filter((item) => item.handle)
|
||||||
.map((item) => ({
|
.map((item) => ({
|
||||||
url: `${base}/${prefix}/${item.handle}`,
|
url: `${base}/${prefix}/${item.handle}`,
|
||||||
lastModified: item.updated_at ? new Date(item.updated_at) : undefined,
|
lastModified: item.updated_at
|
||||||
|
? new Date(item.updated_at)
|
||||||
|
: undefined,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return listCountryCodes(regions).flatMap((countryCode) => {
|
return listCountryCodes(regions).flatMap((countryCode) => {
|
||||||
@@ -69,4 +76,8 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
...toEntries(base, "collections", collections),
|
...toEntries(base, "collections", collections),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
} catch {
|
||||||
|
// During Docker build the backend is not running — return static paths only
|
||||||
|
return STATIC_PATHS.map((path) => ({ url: `${origin}${path}` }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ services:
|
|||||||
dockerfile: apps/suman-bosna/Dockerfile
|
dockerfile: apps/suman-bosna/Dockerfile
|
||||||
args:
|
args:
|
||||||
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
||||||
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_BA:-}
|
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_BA:-pk_b722e44870bc8cc7828d0713980537e95b2e74ff229a529a4b3fa8155035f1f0}
|
||||||
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_BA_BASE_URL:-http://localhost:8000}
|
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_BA_BASE_URL:-http://localhost:8000}
|
||||||
NEXT_PUBLIC_DEFAULT_REGION: ba
|
NEXT_PUBLIC_DEFAULT_REGION: ba
|
||||||
container_name: suman_prod_storefront_bosna
|
container_name: suman_prod_storefront_bosna
|
||||||
@@ -138,7 +138,7 @@ services:
|
|||||||
dockerfile: apps/suman-hrvatska/Dockerfile
|
dockerfile: apps/suman-hrvatska/Dockerfile
|
||||||
args:
|
args:
|
||||||
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
||||||
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_HR:-}
|
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_HR:-pk_suman_hrvatska_publishable_key}
|
||||||
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_HR_BASE_URL:-http://localhost:8002}
|
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_HR_BASE_URL:-http://localhost:8002}
|
||||||
NEXT_PUBLIC_DEFAULT_REGION: hr
|
NEXT_PUBLIC_DEFAULT_REGION: hr
|
||||||
container_name: suman_prod_storefront_hrvatska
|
container_name: suman_prod_storefront_hrvatska
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ services:
|
|||||||
dockerfile: apps/suman-bosna/Dockerfile
|
dockerfile: apps/suman-bosna/Dockerfile
|
||||||
args:
|
args:
|
||||||
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
||||||
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_BA:-}
|
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_BA:-pk_b722e44870bc8cc7828d0713980537e95b2e74ff229a529a4b3fa8155035f1f0}
|
||||||
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_BA_BASE_URL:-http://localhost:8000}
|
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_BA_BASE_URL:-http://localhost:8000}
|
||||||
NEXT_PUBLIC_DEFAULT_REGION: ba
|
NEXT_PUBLIC_DEFAULT_REGION: ba
|
||||||
container_name: suman_prod_storefront_bosna
|
container_name: suman_prod_storefront_bosna
|
||||||
@@ -138,7 +138,7 @@ services:
|
|||||||
dockerfile: apps/suman-hrvatska/Dockerfile
|
dockerfile: apps/suman-hrvatska/Dockerfile
|
||||||
args:
|
args:
|
||||||
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
NEXT_PUBLIC_MEDUSA_BACKEND_URL: ${MEDUSA_BACKEND_URL:-http://backend:9000}
|
||||||
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_HR:-}
|
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY: ${MEDUSA_PUBLISHABLE_KEY_HR:-pk_suman_hrvatska_publishable_key}
|
||||||
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_HR_BASE_URL:-http://localhost:8002}
|
NEXT_PUBLIC_BASE_URL: ${STOREFRONT_HR_BASE_URL:-http://localhost:8002}
|
||||||
NEXT_PUBLIC_DEFAULT_REGION: hr
|
NEXT_PUBLIC_DEFAULT_REGION: hr
|
||||||
container_name: suman_prod_storefront_hrvatska
|
container_name: suman_prod_storefront_hrvatska
|
||||||
|
|||||||
Reference in New Issue
Block a user