mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-27 13:49:10 +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
|
# 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:
|
||||||
build:
|
image: nginx
|
||||||
context: ..
|
volumes:
|
||||||
dockerfile: frontend/Dockerfile
|
- ./frontend/dist:/usr/share/nginx/html
|
||||||
command: |
|
command: |
|
||||||
sh -c "echo \"Waiting for Unleash to start\" && \
|
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;'"
|
||||||
npx wait-on http://unleash:4242/health && \
|
|
||||||
echo \"Unleash is up, starting frontend\" && \
|
|
||||||
yarn run dev"
|
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:80"
|
||||||
environment:
|
environment:
|
||||||
UNLEASH_API: "http://unleash:4242/"
|
UNLEASH_API: "http://unleash:4242/"
|
||||||
healthcheck:
|
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
|
interval: 1s
|
||||||
timeout: 1m
|
timeout: 1m
|
||||||
retries: 10
|
retries: 10
|
||||||
|
5
.github/workflows/e2e.frontend.yaml
vendored
5
.github/workflows/e2e.frontend.yaml
vendored
@ -21,6 +21,11 @@ jobs:
|
|||||||
echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Build static frontend
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
yarn install --immutable
|
||||||
|
yarn build
|
||||||
- name: Start Unleash test instance
|
- name: Start Unleash test instance
|
||||||
run: |
|
run: |
|
||||||
docker compose -f .github/docker-compose.test.yml up -d --wait -t 90
|
docker compose -f .github/docker-compose.test.yml up -d --wait -t 90
|
||||||
|
Loading…
Reference in New Issue
Block a user