Skip to content

Commit 45ec42f

Browse files
committed
Add Dockerfile
1 parent 765ca60 commit 45ec42f

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build_and_test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- run: cargo test
13+
- name: Build Docker image
14+
run: docker build -t terminusdb-change-request-api .
15+
16+
build-and-push-image:
17+
runs-on: ubuntu-latest
18+
needs: [clippy_and_format, build_and_test]
19+
if: startsWith(github.ref, 'refs/tags/v')
20+
env:
21+
IMAGE_NAME: terminusdb/terminusdb-change-request-api
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
29+
with:
30+
username: terminusdb
31+
password: ${{ secrets.DOCKER_PASS }}
32+
33+
- name: Extract metadata (tags, labels) for Docker
34+
id: meta
35+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
36+
with:
37+
images: ${{ env.IMAGE_NAME }}
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:18
2+
3+
WORKDIR /app/
4+
COPY . /app/
5+
RUN npm i --legacy-peer-deps && \
6+
npm run build
7+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)