diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..581eced --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git/ +.parcel-cache/ +dist/ +node_modules/ +.gitignore +package-lock.json +readme.md \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1c72c32..d80835d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -66,9 +66,15 @@ jobs: runs-on: ubuntu-latest steps: - id: meta + name: Extract metadata uses: docker/metadata-action@v5.0.0 with: images: ghcr.io/${{ github.repository }}/stft + - name: Archive metadata + uses: actions/upload-artifact@v2 + with: + name: metadata + path: .docker build_and_push: name: Build and Push @@ -82,13 +88,17 @@ jobs: with: name: source-code path: . - + + - name: Download metadata + uses: actions/download-artifact@v2 + with: + name: metadata + path: .docker + - name: Push to GHCR uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile push: true - tags: ${{ needs.metadata.steps.meta.outputs.tags }} - labels: ${{ needs.metadata.steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..184124b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:20.11.0 as builder + +COPY . . +RUN npm install +RUN npm run build + +FROM nginx:1.24.3 + +COPY --from=builder /dist /usr/share/nginx/html diff --git a/package.json b/package.json index 7276175..2db2c22 100644 --- a/package.json +++ b/package.json @@ -18,5 +18,9 @@ "react": "^18.2.0", "react-bootstrap": "^2.10.0", "react-dom": "^18.2.0" + }, + "optionalDependencies": { + "@parcel/watcher-linux-x64-glibc": "^2.4.0", + "@parcel/watcher-linux-arm64-glibc": "^2.4.0" } }