Add container for harbor-portal

1. Add dockerfile for building harbor-portal
2. change the name from ui_ng to harbor-portal

Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
Qian Deng 2018-09-04 18:14:40 +08:00
parent cd31cbf892
commit dc21f3f5e2
490 changed files with 110 additions and 3323 deletions

20
.gitignore vendored
View File

@ -24,11 +24,11 @@ src/ui/static/styles.css
src/ui/static/i18n
src/ui/static/shapes
src/ui_ng/coverage/
src/ui_ng/dist/
src/ui_ng/html-report/
src/ui_ng/node_modules/
src/ui_ng/typings/
src/portal/coverage/
src/portal/dist/
src/portal/html-report/
src/portal/node_modules/
src/portal/typings/
**/*npm-debug.log.*
**/*yarn-error.log.*
.idea/
@ -39,16 +39,12 @@ src/ui_ng/typings/
**/ssl/
**/proxy.config.json
src/ui_ng/src/**/*.js
src/ui_ng/src/**/*.js.map
src/ui_ng/src/**/*.json
src/portal/src/**/*.js
src/portal/src/**/*.js.map
src/portal/src/**/*.json
**/npm*.log
src/ui_ng/aot/**/*.js
src/ui_ng/aot/**/*.js.map
src/ui_ng/aot/**/*.json
**/*ngsummary.json
**/*ngfactory.ts
**/aot

View File

@ -110,6 +110,21 @@ services:
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "ui"
portal:
image: goharbor/harbor-portal:__version__
container_name: harbor-portal
restart: always
networks:
- harbor
ports:
- 8081:80
- 4433:443
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "ui"
jobservice:
image: goharbor/harbor-jobservice:__version__
container_name: harbor-jobservice

View File

@ -0,0 +1,35 @@
FROM node:10.7.0
RUN mkdir -p /portal_src
RUN mkdir -p /build_dir
COPY make/photon/portal/entrypoint.sh /
COPY src/portal /portal_src
WORKDIR /portal_src
RUN npm install && \
chmod u+x /entrypoint.sh
RUN /entrypoint.sh
VOLUME ["/portal_src"]
FROM photon:1.0
RUN tdnf distro-sync -y \
&& tdnf install -y nginx >> /dev/null \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& tdnf clean all
EXPOSE 80
VOLUME /var/cache/nginx /var/log/nginx /run
COPY --from=0 /build_dir/dist /usr/share/nginx/html
COPY make/photon/portal/nginx.conf /etc/nginx/nginx.conf
STOPSIGNAL SIGQUIT
HEALTHCHECK CMD curl --fail -s http://127.0.0.1 || exit 1
CMD ["nginx", "-g", "daemon off;"]

View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
cd /build_dir
cp -r /portal_src/* .
ls -la
cat ./package.json
npm install
## Build harbor-ui and link it
rm -rf /build_dir/lib/dist
npm run build:lib
chmod -R +xr /build_dir/lib/dist
cd /build_dir/lib/dist
npm link
cd /build_dir
npm link harbor-ui
## Build production
npm run build:prod
## Unlink
npm unlink harbor-ui

View File

@ -0,0 +1,26 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location / {
try_files $uri $uri/ /index.html;
}
}
}

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Some files were not shown because too many files have changed in this diff Show More