feat: add production landing page service and remove Caddy in favor of external reverse proxy configuration
This commit is contained in:
@@ -28,6 +28,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# GreenLens Landing
|
||||
|
||||
Self-hosted Next.js landing page for GreenLens. The production stack in this directory runs:
|
||||
Self-hosted Next.js landing page for GreenLens. The production stack in this directory runs behind an external reverse proxy and includes:
|
||||
|
||||
- `caddy` for TLS and reverse proxy
|
||||
- `landing` for the Next.js standalone app
|
||||
- `api` for the Express backend from `../server`
|
||||
- `postgres` for persistent app data
|
||||
@@ -23,6 +22,13 @@ From `greenlns-landing/docker-compose.yml`:
|
||||
docker compose up --build -d
|
||||
```
|
||||
|
||||
Published ports for the external reverse proxy:
|
||||
|
||||
- `3000` for `landing`
|
||||
- `3001` for `api`
|
||||
- `9000` for MinIO object storage
|
||||
- `9001` for the MinIO console
|
||||
|
||||
Required environment variables:
|
||||
|
||||
- `SITE_DOMAIN`
|
||||
|
||||
@@ -1,27 +1,11 @@
|
||||
services:
|
||||
caddy:
|
||||
image: caddy:2.8-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
environment:
|
||||
SITE_DOMAIN: ${SITE_DOMAIN:-greenlenspro.com}
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
depends_on:
|
||||
landing:
|
||||
condition: service_started
|
||||
api:
|
||||
condition: service_healthy
|
||||
|
||||
landing:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
@@ -37,6 +21,8 @@ services:
|
||||
context: ../server
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:3000"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
@@ -89,10 +75,13 @@ services:
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9001:9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-greenlns-minio}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:?MINIO_SECRET_KEY is required}
|
||||
command: server /data
|
||||
command: server /data --console-address ":9001"
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
healthcheck:
|
||||
@@ -102,7 +91,5 @@ services:
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
caddy_config:
|
||||
caddy_data:
|
||||
postgres_data:
|
||||
minio_data:
|
||||
|
||||
@@ -17,7 +17,7 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://app:3000;
|
||||
proxy_pass http://app:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
|
||||
Reference in New Issue
Block a user