diff --git a/.github/docker-compose.test.yml b/.github/docker-compose.test.yml index 109293cccf..cf7a18216a 100644 --- a/.github/docker-compose.test.yml +++ b/.github/docker-compose.test.yml @@ -15,19 +15,14 @@ services: # The Unleash server contains the Unleash configuration and # communicates with server-side SDKs and the Unleash Proxy frontend: - image: node:20-alpine - working_dir: /app - volumes: - - ..:/src + build: + context: .. + dockerfile: frontend/Dockerfile command: | - sh -c " cp -r /src /app && \ - echo \"Building frontend\" && \ - corepack enable && \ - yarn --cwd ./frontend install && \ - echo \"Waiting for Unleash to start\" && \ + sh -c "echo \"Waiting for Unleash to start\" && \ npx wait-on http://unleash:4242/health && \ echo \"Unleash is up, starting frontend\" && \ - yarn --cwd ./frontend run dev" + yarn run dev" ports: - "3000:3000" environment: @@ -37,7 +32,7 @@ services: interval: 1s timeout: 1m retries: 10 - start_period: 30s + start_period: 45s unleash: image: unleashorg/unleash-enterprise:latest pull_policy: "always" @@ -55,11 +50,11 @@ services: interval: 1s timeout: 1m retries: 5 - start_period: 15s + start_period: 45s db: expose: - "5432" - image: postgres:16 + image: postgres environment: POSTGRES_DB: "unleash" # trust incoming connections blindly (DON'T DO THIS IN PRODUCTION!) diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000000..325ea39901 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,8 @@ +FROM node:20.19.0-alpine3.21 +COPY .. /app +WORKDIR /app +RUN corepack enable +RUN yarn --cwd ./frontend install +ARG UNLEASH_API="http://localhost:4242" +ENV UNLEASH_API=${UNLEASH_API} +WORKDIR /app/frontend \ No newline at end of file