fix frontend redirection
This commit is contained in:
@@ -39,6 +39,6 @@ COPY --from=builder /app/node_modules ./node_modules
|
|||||||
COPY --from=builder /app/apps ./apps
|
COPY --from=builder /app/apps ./apps
|
||||||
COPY --from=builder /app/packages ./packages
|
COPY --from=builder /app/packages ./packages
|
||||||
|
|
||||||
EXPOSE 3000 3001 3002 3003 4000
|
EXPOSE 3000 4000
|
||||||
|
|
||||||
CMD ["npm", "run", "start", "--workspace", "@rentaldrivego/api"]
|
CMD ["npm", "run", "start", "--workspace", "@rentaldrivego/api"]
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"predev": "npm run build --workspace @rentaldrivego/types",
|
"predev": "npm run build --workspace @rentaldrivego/types",
|
||||||
"dev": "next dev -p 3002",
|
"dev": "next dev -p 3003",
|
||||||
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prestart": "npm run build --workspace @rentaldrivego/types",
|
"prestart": "npm run build --workspace @rentaldrivego/types",
|
||||||
"start": "next start -p 3002",
|
"start": "next start -p 3003",
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"predev": "npm run build --workspace @rentaldrivego/types",
|
"predev": "npm run build --workspace @rentaldrivego/types",
|
||||||
"dev": "next dev -p 3001",
|
"dev": "next dev -p 3002",
|
||||||
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prestart": "npm run build --workspace @rentaldrivego/types",
|
"prestart": "npm run build --workspace @rentaldrivego/types",
|
||||||
"start": "next start -p 3001",
|
"start": "next start -p 3002",
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"predev": "npm run build --workspace @rentaldrivego/types",
|
"predev": "npm run build --workspace @rentaldrivego/types",
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3001",
|
||||||
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prestart": "npm run build --workspace @rentaldrivego/types",
|
"prestart": "npm run build --workspace @rentaldrivego/types",
|
||||||
"start": "next start -p 3000",
|
"start": "next start -p 3001",
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -7,6 +7,16 @@ const nextConfig = {
|
|||||||
domains: ['res.cloudinary.com'],
|
domains: ['res.cloudinary.com'],
|
||||||
},
|
},
|
||||||
transpilePackages: ['@rentaldrivego/types'],
|
transpilePackages: ['@rentaldrivego/types'],
|
||||||
|
async rewrites() {
|
||||||
|
return [
|
||||||
|
{ source: '/marketplace', destination: 'http://localhost:3001/marketplace' },
|
||||||
|
{ source: '/marketplace/:path*', destination: 'http://localhost:3001/marketplace/:path*' },
|
||||||
|
{ source: '/dashboard', destination: 'http://localhost:3002/dashboard' },
|
||||||
|
{ source: '/dashboard/:path*', destination: 'http://localhost:3002/dashboard/:path*' },
|
||||||
|
{ source: '/admin', destination: 'http://localhost:3003/admin' },
|
||||||
|
{ source: '/admin/:path*', destination: 'http://localhost:3003/admin/:path*' },
|
||||||
|
]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"predev": "npm run build --workspace @rentaldrivego/types",
|
"predev": "npm run build --workspace @rentaldrivego/types",
|
||||||
"dev": "next dev -p 3003",
|
"dev": "next dev -p 3000",
|
||||||
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
"prebuild": "npm run build --workspace @rentaldrivego/types",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prestart": "npm run build --workspace @rentaldrivego/types",
|
"prestart": "npm run build --workspace @rentaldrivego/types",
|
||||||
"start": "next start -p 3003",
|
"start": "next start -p 3000",
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -91,45 +91,19 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
# marketplace (port 3000) — /marketplace path, priority 20
|
# all frontend traffic → port 3000 (public-site proxies /marketplace, /dashboard, /admin internally)
|
||||||
- traefik.http.routers.marketplace.rule=Host(`${PUBLIC_SITE_DOMAIN}`) && PathPrefix(`/marketplace`)
|
- traefik.http.routers.frontend.rule=Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)
|
||||||
- traefik.http.routers.marketplace.priority=20
|
- traefik.http.routers.frontend.entrypoints=websecure
|
||||||
- traefik.http.routers.marketplace.entrypoints=websecure
|
- traefik.http.routers.frontend.tls=true
|
||||||
- traefik.http.routers.marketplace.tls=true
|
- traefik.http.routers.frontend.tls.certresolver=letsencrypt
|
||||||
- traefik.http.routers.marketplace.tls.certresolver=letsencrypt
|
- traefik.http.routers.frontend.service=frontend-svc
|
||||||
- traefik.http.routers.marketplace.service=marketplace-svc
|
- traefik.http.services.frontend-svc.loadbalancer.server.port=3000
|
||||||
- traefik.http.services.marketplace-svc.loadbalancer.server.port=3000
|
# tenant branded sites — {slug}.rentaldrivego.ma subdomains
|
||||||
# dashboard (port 3001) — /dashboard path, priority 20
|
- traefik.http.routers.frontend-tenants.rule=HostRegexp(`{subdomain:[a-z0-9-]+}.${PUBLIC_SITE_DOMAIN}`)
|
||||||
- traefik.http.routers.dashboard.rule=Host(`${PUBLIC_SITE_DOMAIN}`) && PathPrefix(`/dashboard`)
|
- traefik.http.routers.frontend-tenants.entrypoints=websecure
|
||||||
- traefik.http.routers.dashboard.priority=20
|
- traefik.http.routers.frontend-tenants.tls=true
|
||||||
- traefik.http.routers.dashboard.entrypoints=websecure
|
- traefik.http.routers.frontend-tenants.tls.certresolver=letsencrypt
|
||||||
- traefik.http.routers.dashboard.tls=true
|
- traefik.http.routers.frontend-tenants.service=frontend-svc
|
||||||
- traefik.http.routers.dashboard.tls.certresolver=letsencrypt
|
|
||||||
- traefik.http.routers.dashboard.service=dashboard-svc
|
|
||||||
- traefik.http.services.dashboard-svc.loadbalancer.server.port=3001
|
|
||||||
# admin (port 3002) — /admin path, priority 20
|
|
||||||
- traefik.http.routers.admin.rule=Host(`${PUBLIC_SITE_DOMAIN}`) && PathPrefix(`/admin`)
|
|
||||||
- traefik.http.routers.admin.priority=20
|
|
||||||
- traefik.http.routers.admin.entrypoints=websecure
|
|
||||||
- traefik.http.routers.admin.tls=true
|
|
||||||
- traefik.http.routers.admin.tls.certresolver=letsencrypt
|
|
||||||
- traefik.http.routers.admin.service=admin-svc
|
|
||||||
- traefik.http.services.admin-svc.loadbalancer.server.port=3002
|
|
||||||
# public site (port 3003) — root domain, priority 10
|
|
||||||
- traefik.http.routers.public-site.rule=Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)
|
|
||||||
- traefik.http.routers.public-site.priority=10
|
|
||||||
- traefik.http.routers.public-site.entrypoints=websecure
|
|
||||||
- traefik.http.routers.public-site.tls=true
|
|
||||||
- traefik.http.routers.public-site.tls.certresolver=letsencrypt
|
|
||||||
- traefik.http.routers.public-site.service=public-site-svc
|
|
||||||
- traefik.http.services.public-site-svc.loadbalancer.server.port=3003
|
|
||||||
# tenant branded sites (port 3003) — {slug}.rentaldrivego.ma subdomains
|
|
||||||
- traefik.http.routers.public-site-tenants.rule=HostRegexp(`{subdomain:[a-z0-9-]+}.${PUBLIC_SITE_DOMAIN}`)
|
|
||||||
- traefik.http.routers.public-site-tenants.priority=10
|
|
||||||
- traefik.http.routers.public-site-tenants.entrypoints=websecure
|
|
||||||
- traefik.http.routers.public-site-tenants.tls=true
|
|
||||||
- traefik.http.routers.public-site-tenants.tls.certresolver=letsencrypt
|
|
||||||
- traefik.http.routers.public-site-tenants.service=public-site-svc
|
|
||||||
|
|
||||||
pgmanage:
|
pgmanage:
|
||||||
image: cmdpromptinc/pgmanage-enterprise:latest
|
image: cmdpromptinc/pgmanage-enterprise:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user