Skip to content

Commit

Permalink
Merge pull request #18 from FraunhoferISST/ci/docker
Browse files Browse the repository at this point in the history
Ci/docker
  • Loading branch information
mhellmeier authored Aug 18, 2023
2 parents b81901a + 3b8ecaf commit 89bfcc9
Show file tree
Hide file tree
Showing 14 changed files with 286 additions and 36 deletions.
38 changes: 38 additions & 0 deletions DEPENDENCIES_BACKEND
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.14.1,
maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.14.1, Apache-2.0, approved, #4699
maven/mavencentral/com.fasterxml.jackson.module/jackson-module-parameter-names/2.14.1, Apache-2.0, approved, #5938
maven/mavencentral/com.fasterxml/classmate/1.5.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.jayway.jsonpath/json-path/2.7.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.squareup.okhttp/okhttp/2.7.5, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.squareup.okio/okio/1.6.0, Apache-2.0, approved, CQ11382
maven/mavencentral/com.sun.istack/istack-commons-runtime/4.1.1, BSD-3-Clause, approved, #2590
maven/mavencentral/com.vaadin.external.google/android-json/0.0.20131108.vaadin1, Apache-2.0, approved, CQ21310
maven/mavencentral/com.zaxxer/HikariCP/5.0.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/io.micrometer/micrometer-commons/1.10.3, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #7333
maven/mavencentral/io.micrometer/micrometer-observation/1.10.3, Apache-2.0, approved, #7331
Expand All @@ -18,44 +21,77 @@ maven/mavencentral/io.swagger.core.v3/swagger-core-jakarta/2.2.9, Apache-2.0, ap
maven/mavencentral/io.swagger.core.v3/swagger-models-jakarta/2.2.9, Apache-2.0, approved, #5919
maven/mavencentral/jakarta.activation/jakarta.activation-api/2.1.1, EPL-2.0 OR BSD-3-Clause OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jaf
maven/mavencentral/jakarta.annotation/jakarta.annotation-api/2.1.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.ca
maven/mavencentral/jakarta.inject/jakarta.inject-api/2.0.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/jakarta.persistence/jakarta.persistence-api/3.1.0, EPL-2.0 OR BSD-3-Clause AND (EPL-2.0 OR BSD-3-Clause AND BSD-3-Clause), approved, #7696
maven/mavencentral/jakarta.transaction/jakarta.transaction-api/2.0.1, EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0, approved, #7697
maven/mavencentral/jakarta.validation/jakarta.validation-api/3.0.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/jakarta.xml.bind/jakarta.xml.bind-api/4.0.0, BSD-3-Clause, approved, ee4j.jaxb
maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.12.22, Apache-2.0, approved, #1810
maven/mavencentral/net.bytebuddy/byte-buddy/1.12.22, Apache-2.0 AND BSD-3-Clause, approved, #1811
maven/mavencentral/net.minidev/accessors-smart/2.4.8, Apache-2.0, approved, #7515
maven/mavencentral/net.minidev/json-smart/2.4.8, Apache-2.0, approved, #3288
maven/mavencentral/org.antlr/antlr4-runtime/4.10.1, BSD-3-Clause AND LicenseRef-Public-domain AND MIT AND LicenseRef-Unicode-TOU, approved, #7065
maven/mavencentral/org.apache.commons/commons-lang3/3.12.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.logging.log4j/log4j-api/2.19.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.19.0, Apache-2.0, approved, #5941
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.5, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.5, Apache-2.0, approved, #6997
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.5, Apache-2.0, approved, #7920
maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.aspectj/aspectjweaver/1.9.19, EPL-1.0, approved, tools.aspectj
maven/mavencentral/org.assertj/assertj-core/3.23.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.eclipse.angus/angus-activation/1.0.0, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.angus
maven/mavencentral/org.glassfish.jaxb/jaxb-core/4.0.1, BSD-3-Clause, approved, ee4j.jaxb
maven/mavencentral/org.glassfish.jaxb/jaxb-runtime/4.0.1, BSD-3-Clause, approved, ee4j.jaxb
maven/mavencentral/org.glassfish.jaxb/txw2/4.0.1, BSD-3-Clause, approved, ee4j.jaxb
maven/mavencentral/org.hamcrest/hamcrest/2.2, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/org.hibernate.common/hibernate-commons-annotations/6.0.2.Final, LGPL-2.1-only, approved, #6962
maven/mavencentral/org.hibernate.orm/hibernate-core/6.1.6.Final, LGPL-2.1-or-later AND (Apache-2.0 AND LGPL-2.1-only) AND (CC-PDDC AND LGPL-2.1-only) AND (EPL-2.0 OR BSD-3-Clause), approved, #5939
maven/mavencentral/org.hibernate.validator/hibernate-validator/8.0.0.Final, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.hsqldb/hsqldb/2.7.1, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/org.jboss.logging/jboss-logging/3.5.0.Final, Apache-2.0, approved, #9471
maven/mavencentral/org.jboss/jandex/2.4.2.Final, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.9.2, EPL-2.0, approved, #3133
maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.9.2, EPL-2.0, approved, #3125
maven/mavencentral/org.junit.jupiter/junit-jupiter-params/5.9.2, EPL-2.0, approved, #3134
maven/mavencentral/org.junit.jupiter/junit-jupiter/5.9.2, EPL-2.0, approved, #6972
maven/mavencentral/org.junit.platform/junit-platform-commons/1.9.2, EPL-2.0, approved, #3130
maven/mavencentral/org.junit.platform/junit-platform-engine/1.9.2, EPL-2.0, approved, #3128
maven/mavencentral/org.mockito/mockito-core/4.8.1, MIT, approved, clearlydefined
maven/mavencentral/org.mockito/mockito-junit-jupiter/4.8.1, MIT, approved, clearlydefined
maven/mavencentral/org.modelmapper/modelmapper/3.1.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.objenesis/objenesis/3.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.opentest4j/opentest4j/1.2.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.ow2.asm/asm/9.1, BSD-3-Clause, approved, CQ23029
maven/mavencentral/org.projectlombok/lombok/1.18.24, MIT AND LicenseRef-Public-Domain, approved, CQ23907
maven/mavencentral/org.skyscreamer/jsonassert/1.5.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.slf4j/jul-to-slf4j/2.0.6, MIT, approved, #7698
maven/mavencentral/org.slf4j/slf4j-api/2.0.6, MIT, approved, #5915
maven/mavencentral/org.springdoc/springdoc-openapi-starter-common/2.1.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-api/2.1.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-ui/2.1.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.0.2, Apache-2.0, approved, #6981
maven/mavencentral/org.springframework.boot/spring-boot-configuration-processor/3.0.2, Apache-2.0, approved, #6973
maven/mavencentral/org.springframework.boot/spring-boot-devtools/3.0.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.springframework.boot/spring-boot-starter-aop/3.0.2, Apache-2.0, approved, #6965
maven/mavencentral/org.springframework.boot/spring-boot-starter-data-jpa/3.0.2, Apache-2.0, approved, #7351
maven/mavencentral/org.springframework.boot/spring-boot-starter-jdbc/3.0.2, Apache-2.0, approved, #6974
maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.0.2, Apache-2.0, approved, #7006
maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.0.2, Apache-2.0, approved, #6982
maven/mavencentral/org.springframework.boot/spring-boot-starter-security/3.0.2, Apache-2.0, approved, #7329
maven/mavencentral/org.springframework.boot/spring-boot-starter-test/3.0.2, Apache-2.0, approved, #7001
maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.0.2, Apache-2.0, approved, #6987
maven/mavencentral/org.springframework.boot/spring-boot-starter-web/3.0.2, Apache-2.0, approved, #5945
maven/mavencentral/org.springframework.boot/spring-boot-starter/3.0.2, Apache-2.0, approved, #7330
maven/mavencentral/org.springframework.boot/spring-boot-test-autoconfigure/3.0.2, Apache-2.0, approved, #6966
maven/mavencentral/org.springframework.boot/spring-boot-test/3.0.2, Apache-2.0, approved, #6976
maven/mavencentral/org.springframework.boot/spring-boot/3.0.2, Apache-2.0, approved, #7327
maven/mavencentral/org.springframework.data/spring-data-commons/3.0.1, Apache-2.0, approved, #5943
maven/mavencentral/org.springframework.data/spring-data-jpa/3.0.1, Apache-2.0, approved, #5935
maven/mavencentral/org.springframework.security/spring-security-config/6.0.1, Apache-2.0, approved, #7338
maven/mavencentral/org.springframework.security/spring-security-core/6.0.1, Apache-2.0, approved, #7325
maven/mavencentral/org.springframework.security/spring-security-crypto/6.0.1, Apache-2.0 AND ISC, approved, #7326
maven/mavencentral/org.springframework.security/spring-security-test/6.0.1, Apache-2.0, approved, #7402
maven/mavencentral/org.springframework.security/spring-security-web/6.0.1, Apache-2.0, approved, #7328
maven/mavencentral/org.springframework.session/spring-session-core/3.0.0, Apache-2.0, approved, #7858
maven/mavencentral/org.springframework/spring-aop/6.0.4, Apache-2.0, approved, #5940
Expand All @@ -67,8 +103,10 @@ maven/mavencentral/org.springframework/spring-expression/6.0.4, Apache-2.0, appr
maven/mavencentral/org.springframework/spring-jcl/6.0.4, Apache-2.0, approved, #3283
maven/mavencentral/org.springframework/spring-jdbc/6.0.4, Apache-2.0, approved, #5924
maven/mavencentral/org.springframework/spring-orm/6.0.4, Apache-2.0, approved, #5925
maven/mavencentral/org.springframework/spring-test/6.0.4, Apache-2.0, approved, #7003
maven/mavencentral/org.springframework/spring-tx/6.0.4, Apache-2.0, approved, #5926
maven/mavencentral/org.springframework/spring-web/6.0.4, Apache-2.0, approved, #5942
maven/mavencentral/org.springframework/spring-webmvc/6.0.4, Apache-2.0, approved, #5944
maven/mavencentral/org.webjars/swagger-ui/4.18.2, Apache-2.0, approved, #7850
maven/mavencentral/org.xmlunit/xmlunit-core/2.9.1, Apache-2.0, approved, #6272
maven/mavencentral/org.yaml/snakeyaml/1.33, Apache-2.0, approved, clearlydefined
12 changes: 8 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#
# SPDX-License-Identifier: Apache-2.0
#

FROM maven:3.8.7-eclipse-temurin-17 as build
RUN mkdir /app
WORKDIR /app
Expand All @@ -28,7 +27,12 @@ RUN mvn initialize -f pom.xml
COPY src/ /app/src/
RUN mvn clean package -DskipTests

FROM eclipse-temurin:17
FROM eclipse-temurin:17-jre-alpine
RUN mkdir /opt/app
COPY --from=build /app/target/*.jar /opt/app/scm-be.jar
CMD ["java", "-jar", "/opt/app/scm-be.jar"]
COPY --from=build /app/target/*.jar /opt/app/puris-backend.jar

RUN adduser -u 8877 -D nonroot && chmod 755 /opt/app/puris-backend.jar

USER nonroot

ENTRYPOINT ["sh", "-c", " java ${JAVA_OPTS} -jar /opt/app/puris-backend.jar ${0} ${@}"]
57 changes: 49 additions & 8 deletions backend/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
## Project Installation

The first steps are always the same:
1. Clone the project
2. Make sure the tractusx-edc is running with all its components (control plane, data plane, ...)
2. Make sure the PURIS backend and the tractusx-edc is running with all its components

Depending on your needs of deployment, follow the following steps

### Running using mvn (local develpment)
3. Change the `src/main/resources/application.properties` or the respective environment
variables to configure the port, the URL of the EDC control plane, backend application etc.
4. Run the application:
- (Java) Use `mvn install` to build the project and run the generated `.jar` file
- (Docker) Run `docker build .` and `docker run -d -p 8081:8081 CONTAINERID`
- (Kubernetes) Run `helm install puris-backend`
4a. Run the application with role specific settings:
- Use `mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=customer` to start with customer setup
or
- Use `mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=supplier`to start with supplier setup
```shell
# build and run the generated .jar file
mvn install

# run for demo or development puroposes
# customer role
mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=customer
# supplier role
mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=supplier
```
5. Done! The Swagger UI should be available at
- (Java & Docker) `http://YOURIP:8081/catena/swagger-ui/index.html`
- (Kubernetes) `http://CLUSTERIP:30001/catena/swagger-ui/index.html`
6. It is highly suggested to install and run the PURIS frontend afterward

### Running using docker (deployment)
3. Optional (one can set properties via environment variables to docker): Change the `src/main/resources/application.properties` or the respective environment
variables to configure the port, the URL of the EDC control plane, backend application etc.
4. Run the application:
```shell
cd backend

docker build -t puris-backend:dev .

# A use docker
docker run -d --rm -p 8081:8081 --name backend -e server.port=8082 puris-backend:dev CONTAINERID

# B use docker-compose
docker-compose up
```
5. Done! The Swagger UI should be available at
- (Java & Docker) `http://YOURIP:8081/catena/swagger-ui/index.html`
- (Kubernetes) `http://CLUSTERIP:30001/catena/swagger-ui/index.html`
6. It is highly suggested to install and run the PURIS frontend afterward

### Running using helm (deployment)
Change the `src/main/resources/application.properties` or the respective environment
variables to configure the port, the URL of the EDC control plane, backend application etc.
4. Run the application:
```shell
cd backend/charts

helm install puris-backend
```
5. Done! The Swagger UI should be available at
- (Java & Docker) `http://YOURIP:8081/catena/swagger-ui/index.html`
- (Kubernetes) `http://CLUSTERIP:30001/catena/swagger-ui/index.html`
6. It is highly suggested to install and run the PURIS frontend afterward
36 changes: 36 additions & 0 deletions backend/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2023 Volkswagen AG
# Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer ISST)
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '1'
services:
puris-backend:

Check warning on line 23 in backend/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Healthcheck Not Set

Check containers periodically to see if they are running properly.

Check warning on line 23 in backend/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Host Namespace is Shared

The hosts process namespace should not be shared by containers

Check warning on line 23 in backend/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Memory Not Limited

Memory limits should be defined for each container. This prevents potential resource exhaustion by ensuring that containers consume not more than the designated amount of memory

Check warning on line 23 in backend/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Networks Not Set

Setting networks in services ensures you are not using dockers default bridge (docker0), which shares traffic bewteen all containers.
image: puris-backend:dev
container_name: backend
ports:

Check warning on line 26 in backend/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Container Traffic Not Bound To Host Interface

Incoming container traffic should be bound to a specific host interface
- 8081:8081
environment:
- server.port=8081
- puris.demonstrator.role= #customer/supplier
- edc.controlplane.host=172.17.0.2
- edc.controlplane.data.port=31605
- edc.dataplane.public.port=31503
- edc.idsUrl=http://plato-controlplane:8084/api/v1/ids
- own.bpnl= #BPNL4444444444XX
- own.bpns= #BPNS4444444444XX
25 changes: 24 additions & 1 deletion backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
server.port=${SERVER_PORT:8081}
my.base.url=http://localhost
request.serverendpoint=${my.base.url}:${server.port}/catena/product-stock/request
request.apiassetid=product-stock-request-api
response.serverendpoint=${my.base.url}:${server.port}/catena/product-stock/response

response.apiassetid=product-stock-response-api
edr.endpoint=${my.base.url}:${server.port}/catena/edrendpoint
# DB Configuration
spring.datasource.driver-class-name=${DATASOURCE_DRIVERCLASSNAME:org.hsqldb.jdbc.JDBCDriver}
spring.datasource.url=${DATASOURCE_URL:jdbc:hsqldb:mem:testdb;DB_CLOSE_DELAY=-1}
Expand All @@ -20,3 +22,24 @@ edc.controlplane.data.port=${EDC_CONTROLPLANE_DATA_PORT:31960}
edc.controlplane.key=${EDC_CONTROLPLANE_KEY:password}
edc.backend.url=${EDC_BACKEND_URL:http://172.17.0.2:31048}
minikube.ip=${MINIKUBE_IP:host.minikube.internal}

edc.applydataplaneworkaround=true
edc.dataplane.public.port=30784

# Jackson (JSON)
#spring.jackson.default-property-inclusion=non_empty
#logging.level.org.hibernate.SQL=DEBUG
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true

# Own EDC-IDS-URL
edc.idsUrl=${EDC_IDSURL:http://plato-controlplane:8084/api/v1/ids}
own.bpnl=${OWN_BPNL:BPNL1234567890ZZ}
own.bpns=${OWN_BPNS:BPNS1234567890ZZ}

# The number of minutes before received authentication data
# in the context of a consumer pull is removed from memory
own.edr.deletiontimer=2

puris.apiversion=1.0.0
puris.demonstrator.role=customer
2 changes: 2 additions & 0 deletions frontend/.env.dockerbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_APP_NAME=\$APP_NAME
VITE_BACKEND_BASE_URL=\$BACKEND_BASE_URL
51 changes: 34 additions & 17 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,46 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM node:lts-alpine as build

FROM node:lts-alpine
ARG NPM_BUILD_MODE=dockerbuild
ENV JQ_VERSION=1.6

# build arg for setting mode (local, develop, integration or beta, defaults to develop)
ARG npm_build_mode=develop
# TODO curl results in problem with node during ```npm run ${NPM_BUILD_MODE}```
#RUN apk --no-cache add curl
#RUN curl https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 -o /tmp/jq-linux64
RUN wget --no-check-certificate https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 -O /tmp/jq-linux64
RUN cp /tmp/jq-linux64 /usr/bin/jq
RUN chmod +x /usr/bin/jq

# install simple http server for serving static content
RUN npm install -g http-server

# make the 'app' folder the current working directory
WORKDIR /app
COPY . .

# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
RUN jq 'to_entries | map_values({ (.key) : ("$" + .key) }) | reduce .[] as $item ({}; . + $item)' ./src/config.json > ./src/config.tmp.json && mv ./src/config.tmp.json ./src/config.json

# install project dependencies
RUN npm install
RUN npm install && npm run ${NPM_BUILD_MODE}

Check warning on line 38 in frontend/Dockerfile

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] NPM Install Command Without Pinned Version

Check if packages installed by npm are pinning a specific version.

# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
RUN chmod -R 777 /app/dist


# uses 101 restricted user
FROM nginxinc/nginx-unprivileged:stable-alpine
#FROM nginx:stable-alpine

# commly it would be .../html/js/.*js, but due to the project structure the JS files are in .../html/assets
ENV JSFOLDER=/usr/share/nginx/html/assets/*.js

# use root user to install moreutils for sponge in start-nginx to substring env workaround
USER root

COPY ./start-nginx.sh /usr/bin/start-nginx.sh
RUN apk --no-cache add moreutils

# build app for production with minification
RUN npm run $npm_build_mode
# use non-root user
USER 101

EXPOSE 8080
CMD [ "http-server", "dist" ]
WORKDIR /usr/share/nginx/html
COPY --from=build /app/dist .
ENTRYPOINT [ "start-nginx.sh" ]
# nginx exposes at port 80
# nginx-unpriviledged exposes at port 8080
Loading

0 comments on commit 89bfcc9

Please sign in to comment.