Skip to content
Merged
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
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM node:20 as buildContainer
ARG BASE_HREF=/
WORKDIR /app
COPY . /app
RUN npm install -g npm@latest
RUN npm install --legacy-peer-deps

# max-old-space is needed to avoid any compilation issues because of missing memory
ENV NODE_OPTIONS --max-old-space-size=8192
RUN npm run build:ssr

RUN npm run build:ssr --base-href=${BASE_HREF}

FROM node:20.15.1-alpine

Expand All @@ -23,4 +25,9 @@ COPY --from=buildContainer /app/dist /app/dist
EXPOSE 4000

ENV NODE_ENV=production
CMD ["pm2-runtime", "dist/server/main.js"]
# Make BASE_HREF available at runtime as well
ARG BASE_HREF=/
ENV BASE_HREF=${BASE_HREF}

# Use env var instead of hardcoding
CMD ["sh", "-c", "pm2-runtime dist/server/main.js --base-href=${BASE_HREF}"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
BASE_HREF: /pharos/
container_name: pharos-ui
ports:
- "8041:4000"
environment:
NODE_ENV: production
NODE_OPTIONS: --max-old-space-size=16384
restart: unless-stopped
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"compodoc": "npx compodoc -p tsconfig.app.json -s -w --theme material",
"build:ssr": "npm --no-git-tag-version version patch && npm run prerender",
"build:ssr:dev": "ng build && ng run pharos:server:development",
"serve": "ng serve",
"serve:ssr": "node dist/server/main.js",
"perfmon": "node dist/server/main.js perf",
"rerun:ssr": "npm run build:ssr && say pharos is ready && npm run serve:ssr",
Expand Down
2 changes: 1 addition & 1 deletion src/app/tools/search-component/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {MatTooltip} from '@angular/material/tooltip';
@Component({
standalone: true,
imports: [CommonModule, FormsModule, MatInputModule, ReactiveFormsModule, MatAutocomplete, MatButtonModule,
MatIconModule, MatAutocompleteTrigger, MatOption, SearchComponent, HighlightPipe, MatTooltip],
MatIconModule, MatAutocompleteTrigger, MatOption, HighlightPipe, MatTooltip],
selector: 'pharos-search-component',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
Expand Down