Skip to content

Commit

Permalink
fix: docker build with disable aot
Browse files Browse the repository at this point in the history
  • Loading branch information
askonev committed Nov 19, 2024
1 parent 15ac78b commit fab79e1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master (unreleased)

* Added
* Angular @core 12
* Fixed docker-build script
* Added unit tests on chrome browser via Karma Jasmine
* Ability to create plans from interface
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Palladium

This project was generated with [Angular CLI](https://github.com/angular/angular-cli)
version 1.0.0.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`.
Expand All @@ -15,22 +12,23 @@ You can also use `ng generate directive/pipe/service/class/module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored
in the `dist/` directory.
Use the `-prod` flag for a production build.
Run `ng build` to build the project
(By default use `--configuration production` flag).
The build artifacts will be stored in the `dist/` directory.

## Build with docker
### Build aot disable

Run `./docker-build/build.sh` to build the project without dependencies.
Run `build-aot-disable`. Just-in-Time (JIT) Compiles your application
in the browser at runtime.

## Running unit tests
### Build with docker

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
Run `./docker-build/build.sh` or `npm run build-aot-disable` to build
the project via docker container.

## Running end-to-end tests
## Running unit tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
Install dependensies and run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

Expand Down
9 changes: 4 additions & 5 deletions docker-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM node:16.17.1-buster

RUN mkdir /palladium-view
COPY . /palladium-view
WORKDIR /palladium-view
COPY . .

RUN npm install -g @angular/cli --unsafe-perm && npm install
RUN npm install
RUN npm run build-aot-disable

ENTRYPOINT ["ng"]
CMD ["build", "--aot=false", "--configuration production"]
CMD [ "ls", "-l", "dist" ]
8 changes: 4 additions & 4 deletions docker-build/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
docker build -t palladium_view_builder .
docker run -itd --rm --name palladium_view_builder palladium_view_builder /bin/bash
docker cp palladium_view_builder:/palladium-view/dist ./
docker stop palladium_view_builder
docker build -t palladium_view_builder -f docker-build/Dockerfile .
docker run -it --name palladium_view_builder_tmp palladium_view_builder
docker cp palladium_view_builder_tmp:/palladium-view/dist .
docker rm palladium_view_builder_tmp
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --port 80",
"serve": "ng serve --host 0.0.0.0 --port 4200",
"build": "ng build --aot=true --configuration production",
"build": "ng build --configuration production",
"build-aot-disable": "ng build --configuration production --aot=false --build-optimizer=false",
"docker-build": "/bin/bash docker-build/build.sh",
"postinstall": "ngcc"
},
"private": true,
Expand Down

0 comments on commit fab79e1

Please sign in to comment.