Browse Source

Updates with Dockerfile and tweaks for db persistence

unsubscribe-mute
Matthew Raymer 1 year ago
parent
commit
bcb636c150
  1. 1
      .gitignore
  2. 3
      Dockerfile
  3. 3
      build.sh
  4. 2
      src/db.ts

1
.gitignore

@ -2,3 +2,4 @@
node_modules node_modules
build build
web_push web_push
data

3
Dockerfile

@ -1,6 +1,6 @@
FROM node:18.17.1-alpine3.17 FROM node:18.17.1-alpine3.17
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app/data
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY package*.json ./ COPY package*.json ./
@ -9,6 +9,7 @@ COPY .eslintrc.json ./
COPY src ./src COPY src ./src
RUN npm install RUN npm install
RUN npm run build RUN npm run build
EXPOSE 3000 EXPOSE 3000

3
build.sh

@ -0,0 +1,3 @@
#!/bin/bash
docker build . -t endorser-push-server:1.0 --no-cache

2
src/db.ts

@ -15,7 +15,7 @@ class DBService {
private constructor() { private constructor() {
this.dataSource = new DataSource({ this.dataSource = new DataSource({
type: "sqlite", type: "sqlite",
database: "push_server", database: "data/push_server",
entities: [VapidKeys, Subscription], entities: [VapidKeys, Subscription],
synchronize: true synchronize: true
}); });

Loading…
Cancel
Save