Skip to content
Snippets Groups Projects
Commit 8be5d0d2 authored by Oleksandr Husak's avatar Oleksandr Husak
Browse files

docker container

parent 631a9245
No related branches found
No related tags found
No related merge requests found
# --- STAGE 1: Build
FROM node:14.18-alpine AS build
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
# ---STAGE 2: Run
FROM nginx:1.17.1-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist/MainApp /usr/share/nginx/html
\ No newline at end of file
# MainApp # Frontend App
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.9. ## Messages
## Development server - Public MQTT brocker from [hivemq](https://www.hivemq.com/public-mqtt-broker/).
- `ipos/client/position`: relative position of an agent to a curent root point
- `ipos/client/root`: update a root point. Default is `{"latitude": 51.02545, "longitude": 13.72295}`.
- Messages description: [SimpleSceneIntegration Interface](https://md.inf.tu-dresden.de/IPos_IFSimpleSceneIntegration).
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding ## Run
- 1. Install all dependency and run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
- if you don't want to install all dependencies, you can simply run the application in a container.
1. `docker build -t frontend-osm .`
2. `docker run -p 4200:80 frontend-osm:latest`
3. Navigate to `http://localhost:4200/`
- 2. Send messages to a `hivemq` public brocker
- topic `ipos/client/position`
- new positions
- ```json
{
"object": [
{
"id": "Employee1",
"sensorId": "UWB_1",
"type": "HUMAN",
"sensorType": "UWB",
"position": {
"refSystemId": "ROOT",
"point": {
"x": 13,
"y": 22,
"z": 3
},
"accuracy": 1
},
"orientation": {
"x": 1,
"y": 0.5,
"z": 1,
"w": 1.5
},
"lastPosUpdate": "2021-09-14T09:41:20+00:00"
}
],
"type": "EntryNotification"
}
```
- More objects can be added to the `"object": []`
- There are special colours for objects with id `"Employee1"` - `"Employee4"`. Config: [MarkerColorMap](src/environments/environment.ts)
- topic `ipos/client/root`
- ```json
{
"refSystemId": "ROOT",
"point": {
"latitude": 51.02535,
"longitude": 13.72285
},
"accuracy": 1
}
```
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. ## Help
- This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.9.
- Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
- Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
- Validate JSON: [jsonformatter.org](https://jsonformatter.org/)
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
events{}
http {
include /etc/nginx/mime.types;
server {
listen 80;
server_name frontendOSM;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}
src/favicon.ico

948 B | W: | H:

src/favicon.ico

15 KiB | W: | H:

src/favicon.ico
src/favicon.ico
src/favicon.ico
src/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment