diff --git a/Dockerfile.production b/Dockerfile.production index a8e5a66..5027fe4 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -1,12 +1,15 @@ -FROM --platform=$BUILDPLATFORM angular/ngcontainer as builder +FROM --platform=$BUILDPLATFORM node:18.16.1-alpine AS builder +USER root RUN mkdir /app WORKDIR /app -RUN npm install -g @angular/cli@13 -COPY --chown=node:node src package.json package-lock.json angular.json tsconfig.app.json tsconfig.json tsconfig.spec.json .npmrc ./ -RUN ng build --configuration=production +COPY --chown=node:node src src +COPY --chown=node:node package.json package-lock.json angular.json tsconfig.app.json tsconfig.json tsconfig.spec.json .npmrc ./ +RUN ls +RUN npm install +RUN npm run build FROM nginx:1.25 EXPOSE 80 COPY conf/default.conf /etc/nginx/conf.d/ RUN rm -rf /usr/share/nginx/html/* -COPY --from=builder dist/identity-manager /usr/share/nginx/html +COPY --from=builder app/dist/identity-manager /usr/share/nginx/html CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index e6a7afa..e6e0f7a 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,20 @@ To use this command, you need to first add a package that implements end-to-end ### Running with Docker +**Develop** ```shell -docker build . -t um-identity-manager -docker run --rm -dp 4200:4200 --name um-identity-manager --network eoepcanetwork um-identity-manager +docker build . --progress=plain -t um-identity-manager:develop +docker run --rm -dp 4200:4200 --name um-identity-manager --network eoepcanetwork um-identity-manager:develop ``` +**Production** +```shell +docker build . -f Dockerfile.production --progress=plain -t um-identity-manager:production +docker run --rm -dp 4200:80 --name um-identity-manager --network eoepcanetwork um-identity-manager:production +``` + +Identity manager is available at [localhost:4200](http://localhost:4200). + ### 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.