1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-23 13:46:45 +02:00

Use node http-server with proxy tto unleash

This commit is contained in:
Gastón Fournier 2025-04-17 16:29:50 +02:00
parent be193b31eb
commit c889e5a4f5
No known key found for this signature in database
GPG Key ID: AF45428626E17A8E

View File

@ -15,20 +15,18 @@ services:
# The Unleash server contains the Unleash configuration and # The Unleash server contains the Unleash configuration and
# communicates with server-side SDKs and the Unleash Proxy # communicates with server-side SDKs and the Unleash Proxy
frontend: frontend:
image: nginx image: node:alpine
volumes: working_dir: /app
- ./frontend/dist:/usr/share/nginx/html command: npx http-server ./build -p 80 --cors --proxy http://unleash:4242
command: |
sh -c "printf 'server { listen 80; location / { add_header Access-Control-Allow-Origin \"*\" always; root /usr/share/nginx/html; try_files \$uri \$uri/ =404; }}' > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
ports: ports:
- "3000:80" - "3000:80"
environment: volumes:
UNLEASH_API: "http://unleash:4242/" - ../frontend/build:/app:ro
healthcheck: healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:80/login || exit 1 test: wget --no-verbose --tries=1 --spider http://localhost/health || exit 1
interval: 1s interval: 1s
timeout: 1m timeout: 1m
retries: 10 retries: 5
start_period: 45s start_period: 45s
unleash: unleash:
image: unleashorg/unleash-enterprise:latest image: unleashorg/unleash-enterprise:latest
@ -39,6 +37,7 @@ services:
DATABASE_URL: "postgres://postgres:unleash@db/unleash" DATABASE_URL: "postgres://postgres:unleash@db/unleash"
DATABASE_SSL: "false" DATABASE_SSL: "false"
UNLEASH_LICENSE: "${FRONTEND_TEST_LICENSE}" UNLEASH_LICENSE: "${FRONTEND_TEST_LICENSE}"
LOG_LEVEL: "info"
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
@ -51,7 +50,7 @@ services:
db: db:
expose: expose:
- "5432" - "5432"
image: postgres image: postgres:16
environment: environment:
POSTGRES_DB: "unleash" POSTGRES_DB: "unleash"
# trust incoming connections blindly (DON'T DO THIS IN PRODUCTION!) # trust incoming connections blindly (DON'T DO THIS IN PRODUCTION!)