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:
parent
38293cd691
commit
be193b31eb
15
.github/docker-compose.test.yml
vendored
15
.github/docker-compose.test.yml
vendored
@ -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
|
||||
|
5
.github/workflows/e2e.frontend.yaml
vendored
5
.github/workflows/e2e.frontend.yaml
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user