Skip to content

Commit 3a5f134

Browse files
Merge pull request #1 from terminusdb/add_dockerfile
Add dockerfile
2 parents 87c7cf6 + 45ec42f commit 3a5f134

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
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"]

src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dotenv.config({ path: __dirname+'/../.env' });
2525

2626
app.use('/:prefix/api',
2727
createProxyMiddleware({
28-
target: process.env.SERVER_ENDPOINT,
28+
target: process.env.SERVER_ENDPOINT || "http://localhost:6363",
2929
changeOrigin: false,
3030
// onProxyRes: onProxyRes,
3131
pathRewrite: {
@@ -73,4 +73,4 @@ console.log(
7373
"OpenAPI documentation available in http://localhost:3035/api-documentation"
7474
);
7575

76-
//module.exports = app;
76+
//module.exports = app;

0 commit comments

Comments
 (0)