Commit dc21f3f5 authored by Qian Deng's avatar Qian Deng
Browse files

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: default avatarQian Deng <dengq@vmware.com>
parent cd31cbf8
......@@ -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
......
......@@ -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
......
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;"]
\ No newline at end of file
#!/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
\ No newline at end of file
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;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment