Skip to content

Commit

Permalink
Fix production dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-pimenta-DME committed Jul 4, 2023
1 parent 6b2133f commit 036d962
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
13 changes: 8 additions & 5 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -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;"]
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 036d962

Please sign in to comment.