Skip to content

Commit 98d23c7

Browse files
Ferrorjonaslagoni
andauthored
chore: improve experience when using docker (#1194)
Co-authored-by: Jonas Lagoni <[email protected]>
1 parent ec77f68 commit 98d23c7

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
.git/
12
.github/
23
docs/
4+
modelina-website/

.github/workflows/docker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push: ~
5+
6+
jobs:
7+
build-image:
8+
name: Build Docker Image
9+
env:
10+
DOCKER_BUILDKIT: 1 # Requires Latest Buildx in docker CLI
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform: [linux/amd64,linux/arm64]
15+
16+
runs-on: ubuntu-latest
17+
steps:
18+
-
19+
name: Set Up QEMU
20+
uses: docker/setup-qemu-action@v2
21+
-
22+
name: Set Up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
-
25+
name: Build Image
26+
uses: docker/build-push-action@v3
27+
with:
28+
push: false
29+
load: false
30+
platforms: ${{ matrix.platform }}
31+
cache-from: type=gha
32+
cache-to: type=gha

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,3 @@ ENV PATH $PATH:/usr/lib/kotlinc/bin
3535

3636
# Setup library
3737
RUN apt-get install -yq chromium
38-
39-
COPY package.json package-lock.json ./
40-
RUN npm install
41-
COPY . ./

docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
modelina:
3+
working_dir: /app/
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
volumes:
8+
- ./:/app:delegated

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
"build:cjs": "tsc",
8080
"build:esm": "tsc --project tsconfig.json --module ESNext --outDir ./lib/esm",
8181
"build:types": "tsc --project tsconfig.json --declaration --emitDeclarationOnly --declarationMap --outDir ./lib/types",
82-
"docker:build": "docker build -t asyncapi/modelina .",
83-
"docker:test": "npm run docker:build && docker run asyncapi/modelina npm run test",
84-
"docker:test:blackbox": "npm run docker:build && docker run asyncapi/modelina npm run test:blackbox",
82+
"docker:build": "docker compose run --build modelina npm install",
83+
"docker:test": "docker compose run modelina npm run test",
84+
"docker:test:blackbox": "docker compose run modelina npm run test:blackbox",
8585
"test": "npm run test:library && npm run test:examples",
8686
"test:update": "npm run test:library -- -u && npm run test:examples:update",
8787
"test:library": "cross-env CI=true jest --coverage --testPathIgnorePatterns ./test/blackbox --testPathIgnorePatterns ./examples",

0 commit comments

Comments
 (0)