Refactor demo URLs and add nginx reverse-proxy configuration
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
# Ensure remote path exists before scp
|
# Ensure remote path exists before scp
|
||||||
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "mkdir -p $REMOTE_ENV_PATH"
|
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "mkdir -p $REMOTE_ENV_PATH"
|
||||||
scp -P "$PORT" docker-compose.yml "$DEPLOY_USER@$HOST:$REMOTE_ENV_PATH/docker-compose.yml"
|
scp -P "$PORT" docker-compose.yml "$DEPLOY_USER@$HOST:$REMOTE_ENV_PATH/docker-compose.yml"
|
||||||
|
scp -P "$PORT" nginx.conf "$DEPLOY_USER@$HOST:$REMOTE_ENV_PATH/nginx.conf"
|
||||||
|
|
||||||
echo "Deploying DEMO on $HOST"
|
echo "Deploying DEMO on $HOST"
|
||||||
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "
|
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
services:
|
services:
|
||||||
|
reverse-proxy:
|
||||||
|
image: nginx:latest
|
||||||
|
container_name: demo-nginx-proxy
|
||||||
|
ports:
|
||||||
|
- "25700:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
image: registry.boomlab.party/rheinsw/demo-websites/main-website
|
image: registry.boomlab.party/rheinsw/demo-websites/main-website
|
||||||
container_name: main-website
|
container_name: main-website
|
||||||
@@ -10,5 +18,5 @@ services:
|
|||||||
image: registry.boomlab.party/rheinsw/demo-websites/ld1
|
image: registry.boomlab.party/rheinsw/demo-websites/ld1
|
||||||
container_name: ld1
|
container_name: ld1
|
||||||
ports:
|
ports:
|
||||||
- "25601:8080"
|
- "25601:3000"
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import type {NextConfig} from "next";
|
import type {NextConfig} from "next";
|
||||||
|
|
||||||
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
output: 'standalone',
|
||||||
|
basePath: isProd ? '/lawfirm-demos/demo1' : '',
|
||||||
|
assetPrefix: isProd ? '/lawfirm-demos/demo1' : '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
|
// Base URL
|
||||||
|
const BASE_URL = process.env.NEXT_PUBLIC_DEMO_BASE_URL ?? 'http://localhost';
|
||||||
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
export const demoCategories = [
|
export const demoCategories = [
|
||||||
{
|
{
|
||||||
label: 'Anwaltskanzlei',
|
label: 'Anwaltskanzlei',
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
name: 'Anwaltskanzlei Demo 1',
|
name: 'Anwaltskanzlei Demo 1',
|
||||||
url: 'http://localhost:5101',
|
url: isProd ? '/lawfirm-demos/demo1/' : `${BASE_URL}:25601`,
|
||||||
preview: '/previews/lawfirm-1.png',
|
preview: '/previews/lawfirm-1.png',
|
||||||
description: [
|
description: [
|
||||||
'Modernes Design',
|
'Modernes Design',
|
||||||
@@ -14,7 +18,7 @@ export const demoCategories = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Anwaltskanzlei Demo 2',
|
name: 'Anwaltskanzlei Demo 2',
|
||||||
url: 'http://localhost:5101',
|
url: isProd ? '/lawfirm-demos/demo2/' : `${BASE_URL}:25602`,
|
||||||
preview: '/previews/lawfirm-1.png',
|
preview: '/previews/lawfirm-1.png',
|
||||||
description: [
|
description: [
|
||||||
'Modernes Design',
|
'Modernes Design',
|
||||||
@@ -30,7 +34,7 @@ export const demoCategories = [
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
name: 'SaaS Landing Page',
|
name: 'SaaS Landing Page',
|
||||||
url: 'http://localhost:5201',
|
url: isProd ? '/lawfirm-demos/demo2/' : `${BASE_URL}:25801`,
|
||||||
preview: '/previews/saas-1.png',
|
preview: '/previews/saas-1.png',
|
||||||
description: [
|
description: [
|
||||||
'Klares und minimales UI',
|
'Klares und minimales UI',
|
||||||
|
|||||||
34
nginx.conf
Normal file
34
nginx.conf
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://main-website:3000;
|
||||||
|
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 /lawfirm-demos/demo1/ {
|
||||||
|
proxy_pass http://ld1:8080/;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add more locations as needed for other demos
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user