Finalise release details

This commit is contained in:
Fred Boniface 2025-06-26 21:14:27 +01:00
parent 6733bd1669
commit e5a06db550
8 changed files with 64 additions and 7 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
.env
node_modules
dist
dockercompose
dockerfile

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
.env
dockercompose.yaml
dockercompose.yaml
dist

View File

@ -0,0 +1,21 @@
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:18-alpine AS runtime
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/static ./static
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "./dist/index.js"]

17
package-lock.json generated
View File

@ -16,7 +16,8 @@
"devDependencies": {
"@types/express": "^5.0.3",
"@types/node": "^24.0.4",
"@types/nodemailer": "^6.4.17"
"@types/nodemailer": "^6.4.17",
"typescript": "^5.8.3"
}
},
"node_modules/@mongodb-js/saslprep": {
@ -1113,6 +1114,20 @@
"node": ">= 0.6"
}
},
"node_modules/typescript": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",

View File

@ -23,6 +23,7 @@
"devDependencies": {
"@types/express": "^5.0.3",
"@types/node": "^24.0.4",
"@types/nodemailer": "^6.4.17"
"@types/nodemailer": "^6.4.17",
"typescript": "^5.8.3"
}
}

View File

@ -1,6 +1,6 @@
import nodemailer from 'nodemailer';
import type { Transporter, SendMailOptions } from 'nodemailer';
import { Report, Report as ReportSchema } from './models/report';
import { Report, Report as ReportSchema } from './models/report.js';
export interface Fault {
coach: string;
@ -15,7 +15,7 @@ export interface Report {
faults: Fault[];
}
export async function handleFormData(data) {
export async function handleFormData(data: any) {
// Uploads form data to database and emails
// to defined subscribers.

View File

@ -1,6 +1,6 @@
import express, { Request, Response } from "express";
import { handleFormData } from "./formHandler";
import { initDb } from "./database";
import { handleFormData } from "./formHandler.js";
import { initDb } from "./database.js";
const app = express();
const port = process.env.port || 3000;

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2020",
"moduleResolution": "node",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"removeComments": true,
"resolveJsonModule": true
},
"include": ["src/**/*"]
}