1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

Use nginx to serve static

This commit is contained in:
Gastón Fournier 2025-04-17 15:33:46 +02:00
parent 38293cd691
commit be193b31eb
No known key found for this signature in database
GPG Key ID: AF45428626E17A8E
2 changed files with 11 additions and 9 deletions

View File

@ -15,20 +15,17 @@ services:
# The Unleash server contains the Unleash configuration and
# communicates with server-side SDKs and the Unleash Proxy
frontend:
build:
context: ..
dockerfile: frontend/Dockerfile
image: nginx
volumes:
- ./frontend/dist:/usr/share/nginx/html
command: |
sh -c "echo \"Waiting for Unleash to start\" && \
npx wait-on http://unleash:4242/health && \
echo \"Unleash is up, starting frontend\" && \
yarn run dev"
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:
- "3000:3000"
- "3000:80"
environment:
UNLEASH_API: "http://unleash:4242/"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:3000/login || exit 1
test: wget --no-verbose --tries=1 --spider http://localhost:80/login || exit 1
interval: 1s
timeout: 1m
retries: 10

View File

@ -21,6 +21,11 @@ jobs:
echo "$GITHUB_CONTEXT"
- name: Checkout
uses: actions/checkout@v4
- name: Build static frontend
run: |
cd frontend
yarn install --immutable
yarn build
- name: Start Unleash test instance
run: |
docker compose -f .github/docker-compose.test.yml up -d --wait -t 90