Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
node_modules
docker-compose.*
**/.idea
**/node_modules
**/docker-compose.*
.dockerignore
3 changes: 1 addition & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- name: Run Sample App in Docker
run: |
cp .env.docker.example .env.docker &&
npm run docker:up -- -d &&
while ! nc -z localhost 4400; do sleep 1; done
npm run docker:e2e:up -- --wait

- name: Install Chrome v111
uses: browser-actions/setup-chrome@v1
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.local-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
metabase:
volumes:
- type: bind
source: ./local-dist/metabase.jar
target: /app/metabase.jar
read_only: true
bind:
create_host_path: false
20 changes: 15 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
services:
metabase:
build:
context: .
dockerfile: metabase/Dockerfile
image: metabase/metabase-enterprise:v1.55.x
environment:
MB_CONFIG_FILE_PATH: "./app/init-config.yml"
MB_CONFIG_FILE_PATH: "./app/config.yml"
MB_JETTY_PORT: "${MB_PORT}"
MB_EDITION: "ee"
MB_SITE_URL: "http://localhost:${MB_PORT}/"
Expand All @@ -19,6 +17,8 @@ services:
retries: 10
ports:
- "${MB_PORT}:${MB_PORT}"
volumes:
- ./metabase/config.yml:/app/config.yml

next-sample-app-router:
depends_on:
Expand All @@ -38,6 +38,11 @@ services:
NEXT_PUBLIC_METABASE_INSTANCE_URL: "http://localhost:${MB_PORT}"
METABASE_INSTANCE_URL: "http://metabase:${MB_PORT}"
METABASE_JWT_SHARED_SECRET: "${METABASE_JWT_SHARED_SECRET}"
healthcheck:
test: curl --fail -X GET -I "http://localhost:${CLIENT_PORT_APP_ROUTER}/" || exit 1
interval: 2s
timeout: 2s
retries: 5
ports:
- "${CLIENT_PORT_APP_ROUTER}:${CLIENT_PORT_APP_ROUTER}"
volumes:
Expand All @@ -51,7 +56,7 @@ services:
context: .
dockerfile: ./next-sample-pages-router/Dockerfile
args:
PORT: "${CLIENT_PORT_APP_ROUTER}"
PORT: "${CLIENT_PORT_PAGES_ROUTER}"
NEXT_PUBLIC_METABASE_INSTANCE_URL: "http://localhost:${MB_PORT}"
METABASE_INSTANCE_URL: "http://metabase:${MB_PORT}"
METABASE_JWT_SHARED_SECRET: "${METABASE_JWT_SHARED_SECRET}"
Expand All @@ -61,6 +66,11 @@ services:
NEXT_PUBLIC_METABASE_INSTANCE_URL: "http://localhost:${MB_PORT}"
METABASE_INSTANCE_URL: "http://metabase:${MB_PORT}"
METABASE_JWT_SHARED_SECRET: "${METABASE_JWT_SHARED_SECRET}"
healthcheck:
test: curl --fail -X GET -I "http://localhost:${CLIENT_PORT_PAGES_ROUTER}/" || exit 1
interval: 2s
timeout: 2s
retries: 5
ports:
- "${CLIENT_PORT_PAGES_ROUTER}:${CLIENT_PORT_PAGES_ROUTER}"
volumes:
Expand Down
11 changes: 0 additions & 11 deletions metabase/Dockerfile

This file was deleted.

File renamed without changes.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"scripts": {
"start": "npm run docker:up",
"docker:up": "docker compose --env-file .env.docker up",
"docker:down": "docker compose --env-file .env.docker down --rmi all --volumes"
"docker:e2e:up": "yarn docker:up",
"docker:local-dist:up": "docker compose -f docker-compose.yml -f docker-compose.local-dist.yml --env-file .env.docker up",
"docker:down": "docker compose --env-file .env.docker down",
"docker:rm": "yarn docker:down --rmi all --volumes"
}
}
13 changes: 10 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ This option should be used if you don't want to test Metabase Embedding SDK with

From the root directory:
- Copy `.env.docker.example` to `.env.docker` and replace `<your_enterprise_token>` with your premium embedding token
- Start all services in Docker with `yarn start`
- Start all services in Docker with `yarn docker:up`

It will:
- poll a Metabase image and run it
- build and run both `next-sample-app-router` and `next-sample-pages-router` apps
- Poll a Metabase image and run it
- Build and run containers with both `next-sample-app-router` and `next-sample-pages-router` apps and run it

The pages router sample will start on port 4401 and the app router sample will start on port 4400.

#### Local development (For Metabase developers)

- To run containers with a locally built `metabase.jar`, copy it to the `./local-dist` folder as `./local-dist/metabase.jar`.
- To run containers with a locally built Embedding SDK package, copy it to the `./local-dist` folder as `./local-dist/embedding-sdk`.
- Run `yarn docker:local-dist:up` to start containers and use locally built dist from the `./local-dist` folder.
- To remove containers and images completely run `yarn docker:rm`.

## Authentication

Both apps provide an endpoint for user authentication, replace the logic to match your authentication system.