Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Angular 15 #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/frontend_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14.18
node-version: 18.18.2
- name: Install frontend Node.js dependencies
working-directory: frontend
shell: bash
Expand Down
56 changes: 15 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,30 @@
FROM --platform=amd64 node:16 as build-frontend
# Cannot use alpine because we need a distro that uses glibgc instead of musl for node-canvas
# eg: https://github.com/nodejs/build/issues/1140
# canvas prebuilds to target https://github.com/Automattic/node-canvas/releases
FROM --platform=amd64 node:18-slim

# Set the working directory
WORKDIR /app

# Add the source code to app
COPY ./frontend /app/bpni
COPY ./lib /app/lib

# Generate the lib packages
WORKDIR /app/lib
RUN npm install

WORKDIR /app/bpni

# Install all the backend dependencies
RUN npm install

# Generate the build of the application
RUN npm run build

# Copy the build output to replace the default nginx contents.

# Stage 1: Compile and Build angular codebase

# Use official node image as the base image
FROM --platform=amd64 node:14 as build

# Set the working directory
WORKDIR /app
RUN npm install -g [email protected]

# Add the source code to app
COPY ./ /app/bpni

# Set the new working dir
WORKDIR /app/bpni

# Generate the lib packages
WORKDIR /app/bpni/lib
RUN npm install
RUN npm ci --verbose

# Install all the backend dependencies
WORKDIR /app/bpni
RUN npm install
# build the frontend
WORKDIR /app/bpni/frontend
RUN npm ci --verbose
ENV NG_CLI_ANALYTICS=false
RUN npm run build

# Generate the build of the application
# build the backend
WORKDIR /app/bpni
RUN npm ci --verbose
RUN npm run tsc

# Copy over frontend
COPY --from=build-frontend /app/bpni/dist/blueprintnotincluded /app/bpni/app/public
RUN cp -r frontend/dist/blueprintnotincluded/* app/public

# Expose port 3000
EXPOSE 3000

#RUN npm run dev
ENTRYPOINT npm run dev
17 changes: 8 additions & 9 deletions app/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { CallbackError } from 'mongoose';
import passport from 'passport';
import { Strategy } from 'passport-local'
import { UserModel } from './models/user';
import { User, UserModel } from './models/user';

export class Auth
{
constructor()
{
export class Auth {
constructor() {
let localStrategy = new Strategy(
function(username, password, done) {
UserModel.model.findOne({ username: username }, function (err, user) {
function (username, password, done) {
UserModel.model.findOne({ username: username }, function (err: CallbackError, user: User) {

if (err) { return done(err); }

// Return if user not found in database
if (!user) {
return done(null, false, {
Expand Down
Loading
Loading