Added docker config

This commit is contained in:
Mike Conrad
2023-08-31 16:17:56 -04:00
parent c1b9a1fa41
commit e0d4cb41b0
5 changed files with 32 additions and 2 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules/*

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:18 AS Build
WORKDIR /app/node/
COPY . .
RUN yarn
RUN yarn build
FROM nginx AS Production
WORKDIR /usr/share/nginx/html
COPY --from=Build /app/node/dist /usr/share/nginx/html/

View File

@ -2,7 +2,7 @@ import totp from 'totp-generator'
const period = 30
const digits = 6
export function displayToken(secret) {
export function displayToken(secret: string) {
const token = totp(secret.replace(/ /g, '').trim(), {
digits,
period,

View File

@ -1,4 +1,4 @@
import { displayTokenListItem } from "./TokenListItem";
import { displayTokenListItem } from "./tokenListItem";
import { tokens } from "./tokens";
export function tokenList() {

20
tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": [],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["src"]
}