diff --git a/admin-ui/Dockerfile b/admin-ui/Dockerfile new file mode 100644 index 0000000000..d98927bcce --- /dev/null +++ b/admin-ui/Dockerfile @@ -0,0 +1,27 @@ +FROM node:22.13.1-alpine3.21 AS builder + +RUN apk add --no-cache openjdk17 + +RUN deluser --remove-home node \ + && addgroup -S node -g 1000 \ + && adduser -S -G node -u 1000 node + +WORKDIR /app +ENV HOME /app/.cache + +RUN mkdir /app/.cache + +RUN chown -R 1000:1000 /app + +COPY --chown=1000:1000 ./package*.json /app/ + +ENV NODE_ENV=${ENVIRONMENT:-development} +RUN npm install @openapitools/openapi-generator-cli -g +RUN npm install + + +COPY --chown=1000:1000 . /app + +COPY docker-entrypoint.sh / +RUN chmod +x /docker-entrypoint.sh +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/admin-ui/README.md b/admin-ui/README.md index e01072a4c3..e4a8c6028e 100644 --- a/admin-ui/README.md +++ b/admin-ui/README.md @@ -69,7 +69,7 @@ npm run api 6. Run the project. ``` -npm run install +npm run start ``` Once the project is compiled and started, UI can be accessed at URL: http://localhost:4100 diff --git a/admin-ui/docker-compose.yml b/admin-ui/docker-compose.yml new file mode 100644 index 0000000000..0b678798dc --- /dev/null +++ b/admin-ui/docker-compose.yml @@ -0,0 +1,22 @@ +services: + admin-ui: + image: admin-ui + build: + context: ./ + target: "builder" + restart: always + ports: + - 4100:4100 + environment: + - CHOKIDAR_USEPOLLING=true + volumes: + # mount app folder into container + - ./:/app + # ignore local node_modules, use container + - /app/node_modules + command: "npm run start" + networks: + - cloud_bridge +networks: + cloud_bridge: + driver: bridge diff --git a/admin-ui/docker-entrypoint.sh b/admin-ui/docker-entrypoint.sh new file mode 100644 index 0000000000..3010943270 --- /dev/null +++ b/admin-ui/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +set -eu +npm run api +exec "$@"