Skip to content

Commit

Permalink
feat: build and publish data-dev container (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdabbs authored Jan 15, 2024
1 parent 8717bef commit 1b92a02
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 821 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
*Dockerfile*
node_modules
49 changes: 49 additions & 0 deletions .github/workflows/data-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish data-dev Docker image

on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: pi-base/data-dev

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: images/data-dev/Dockerfile

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: images/data-dev/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 22 additions & 0 deletions images/data-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pnpm.io/docker
FROM node:18-slim AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

EXPOSE 3141/tcp
EXPOSE 4173/tcp

RUN corepack enable

VOLUME /data

COPY . /app
WORKDIR /app

COPY ./images/data-dev/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"]
3 changes: 3 additions & 0 deletions images/data-dev/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm run --filter compile dev &

VITE_BUNDLE_SSE=true VITE_BUNDLE_HOST=/bundle pnpm run --filter viewer dev --host
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
},
"devDependencies": {
"@types/node": "^18.16.6",
"@vitest/coverage-c8": "^0.29.8",
"@vitest/coverage-v8": "^0.34.0",
"nodemon": "^2.0.22",
"npm-check-updates": "^16.14.6",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"vite": "^3.2.6",
"vitest": "^0.31.0"
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vitest": "^0.34.6"
}
}
4 changes: 2 additions & 2 deletions packages/core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default defineConfig({
test: {
coverage: {
lines: 93.04,
branches: 94.35,
branches: 93.52,
statements: 93.04,
functions: 84.21,
functions: 93.54,
skipFull: true,
thresholdAutoUpdate: true,
exclude: ['src/Formula/Grammar.ts', 'test'],
Expand Down
8 changes: 4 additions & 4 deletions packages/viewer/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export default defineConfig({
test: {
include: ['src/**/*.{test,spec}.{js,ts}'],
coverage: {
lines: 82.91,
branches: 87.36,
statements: 82.91,
functions: 80.19,
lines: 82.99,
branches: 85.71,
statements: 82.99,
functions: 81.33,
skipFull: true,
thresholdAutoUpdate: true,
},
Expand Down
Loading

0 comments on commit 1b92a02

Please sign in to comment.