Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit 6f14253

Browse files
committed
Add Docker configuration and build process***
***Archive and download metadata during CI/CD*** ***Update package.json with optional dependencies
1 parent 7188e23 commit 6f14253

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git/
2+
.parcel-cache/
3+
dist/
4+
node_modules/
5+
.gitignore
6+
package-lock.json
7+
readme.md

.github/workflows/pull_request.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ jobs:
6666
runs-on: ubuntu-latest
6767
steps:
6868
- id: meta
69+
name: Extract metadata
6970
uses: docker/metadata-action@v5.0.0
7071
with:
7172
images: ghcr.io/${{ github.repository }}/stft
73+
- name: Archive metadata
74+
uses: actions/upload-artifact@v2
75+
with:
76+
name: metadata
77+
path: .docker
7278

7379
build_and_push:
7480
name: Build and Push
@@ -82,13 +88,17 @@ jobs:
8288
with:
8389
name: source-code
8490
path: .
85-
91+
92+
- name: Download metadata
93+
uses: actions/download-artifact@v2
94+
with:
95+
name: metadata
96+
path: .docker
97+
8698
- name: Push to GHCR
8799
uses: docker/build-push-action@v2
88100
with:
89101
context: .
90102
file: ./Dockerfile
91103
push: true
92-
tags: ${{ needs.metadata.steps.meta.outputs.tags }}
93-
labels: ${{ needs.metadata.steps.meta.outputs.labels }}
94104
platforms: linux/amd64,linux/arm64

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:20.11.0 as builder
2+
3+
COPY . .
4+
RUN npm install
5+
RUN npm run build
6+
7+
FROM nginx:1.24.3
8+
9+
COPY --from=builder /dist /usr/share/nginx/html

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@
1818
"react": "^18.2.0",
1919
"react-bootstrap": "^2.10.0",
2020
"react-dom": "^18.2.0"
21+
},
22+
"optionalDependencies": {
23+
"@parcel/watcher-linux-x64-glibc": "^2.4.0",
24+
"@parcel/watcher-linux-arm64-glibc": "^2.4.0"
2125
}
2226
}

0 commit comments

Comments
 (0)