Fixing schema and adding docker builds.
parent
4dd5fa2b15
commit
fcc421c177
|
@ -0,0 +1,13 @@
|
|||
FROM node:16
|
||||
WORKDIR /app
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y sqlite3
|
||||
RUN mkdir -p /app/data
|
||||
COPY ./package*.json /app
|
||||
COPY ./*.js /app
|
||||
COPY ./config-dev.json /app
|
||||
COPY ./schema/ddl.sql /app/ddl.sql
|
||||
RUN npm install
|
||||
RUN echo "You can provide some initialization for sqlite3 database"
|
||||
RUN sqlite3 /app/data/people.dat < /app/ddl.sql
|
||||
CMD node /app/index.js /app/config-dev.json
|
|
@ -1,3 +1,13 @@
|
|||
# How to start backend
|
||||
|
||||
node .\index.js .\config-dev.json
|
||||
node .\index.js .\config-dev.json
|
||||
|
||||
# Building docker image
|
||||
|
||||
Please proceed with following steps:
|
||||
|
||||
- execute 'docker build --no-cache . -t frontend-showcase-backend:latest'
|
||||
- check if 'docker run frontend-showcase-backend:latest' works well
|
||||
- execute 'docker login'
|
||||
- execute 'docker tag frontend-showcase-backend:latest tpolgrabia/frontend-showcase-backend:latest'
|
||||
- execute 'docker push tpolgrabia/frontend-showcase-backend:latest'
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
docker build --no-cache . -t frontend-showcase-backend:latest
|
||||
docker tag frontend-showcase-backend:latest tpolgrabia/frontend-showcase-backend:latest
|
||||
docker push tpolgrabia/frontend-showcase-backend:latest
|
|
@ -3,9 +3,9 @@ create table persons (
|
|||
firstName text not null,
|
||||
lastName text not null,
|
||||
email varchar(256) not null,
|
||||
status integer default 0
|
||||
created_at date not null default datetime('now', 'localtime'),
|
||||
updated_at date not null default datetime('now', 'localtime')
|
||||
status integer default 0,
|
||||
created_at date not null default current_timestamp,
|
||||
updated_at date not null default current_timestamp
|
||||
);
|
||||
|
||||
create trigger update_at_persons
|
||||
|
|
Loading…
Reference in New Issue