Skip to content
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
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ RUN echo "Building with Endpoint ${MW_ENDPOINT} and Port ${MW_PORT}"
RUN npm ci
RUN npm run build

# Build client
FROM node:16.8-bullseye AS build_client

WORKDIR /usr/src/app
RUN git clone https://github.com/manniwatch/manniwatch.git ./
RUN npm ci
RUN npx lerna bootstrap --ci --scope @manniwatch/client-ng --include-dependencies --concurrency=1
COPY --chown=node:node ./extra/environment.example.ts packages/client-ng/src/environments/environment.ts
COPY --chown=node:node ./extra/environment.example.ts packages/client-ng/src/environments/environment.prod.ts
RUN npx lerna run build $(npx lerna ls --scope @manniwatch/client-ng --include-dependencies | grep -v '^@manniwatch/client-ng$' | xargs -n1 echo '--scope') --stream
RUN npx lerna run build:pug --scope=@manniwatch/client-ng
RUN npx lerna run build:release --scope=@manniwatch/client-ng
RUN ls -R ./packages/client-ng/dist

# Build Final Image
FROM apline_container

Expand All @@ -30,7 +44,8 @@ WORKDIR /usr/src/app
COPY --chown=node:node package*.json tsconfig*.json ./
COPY --chown=node:node ./src ./src
COPY --from=build_server --chown=node:node /usr/src/app/dist ./dist

COPY --from=build_client --chown=node:node /usr/src/app/packages/client-ng/dist/manniwatch /manniwatch/client
RUN ls -R /manniwatch/client
ENV NODE_ENV="production"
RUN npm ci --production && \
npm cache clean --force
Expand Down
3 changes: 3 additions & 0 deletions docker-compose-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
services:
web:
command: full
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ version: "3.9"
services:
web:
container_name: manniwatch_web_server
image: manniwatch/test
build: .
stop_signal: SIGINT
init: true
ports:
- "4200:3000"
environment:
NODE_ENV: production
MW_ENDPOINT: https://kvg-kiel.de
1 change: 1 addition & 0 deletions extra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Files needed to build docker image
31 changes: 31 additions & 0 deletions extra/environment.example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*!
* Source https://github.com/manniwatch/manniwatch Package: client-ng
*/

import { IEnvironmentBase } from '@manniwatch/client-types';
import MVT from 'ol/format/MVT';

export const environment: IEnvironmentBase = {
apiEndpoint: '/api/',
map: {
center: {
lat: 0,
lon: 0,
},
mapProvider: {
options: {
format: new MVT(),
maxZoom: 14,
/**
* Please replace with correct url
* This one doesnt work!
*/
url: 'https://manniwatch.github.io/tiles/{z}/{x}/{y}.pbf',
},
type: 'vector',
},
zoom: 0,
},
production: true,
pwa: false,
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"lint:fix": "eslint -c .eslintrc.js --ext .ts ./src --fix",
"postlint:fix": "prettier --config .prettierrc src/**/*.ts src/*.ts --write",
"docs": "typedoc --options ../../typedoc.json",
"prepublishOnly": "npm run test && npm run docs && npm run build"
"prepublishOnly": "npm run test && npm run docs && npm run build",
"compose:api": "docker compose -f docker-compose.yml up",
"compose:full": "docker compose -f docker-compose.yml -f docker-compose-full.yml up"
},
"homepage": "https://manniwatch.github.io/docker/",
"author": {
Expand Down