5 changed files with 390 additions and 84 deletions
@ -1,21 +1,36 @@ |
|||
FROM repository.anxinyun.cn/devops/node:12-dev as builder |
|||
# FROM repository.anxinyun.cn/devops/node:12-dev as builder |
|||
|
|||
COPY . /var/app |
|||
# COPY . /var/app |
|||
|
|||
WORKDIR /var/app |
|||
# WORKDIR /var/app |
|||
|
|||
EXPOSE 8080 |
|||
# EXPOSE 8080 |
|||
|
|||
# RUN npm config set registry=http://10.8.30.22:7000 |
|||
# RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|||
# RUN npm cache clean -f |
|||
# RUN rm -rf package-lock.json |
|||
# RUN npm install --registry http://10.8.30.22:7000 |
|||
|
|||
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 |
|||
|
|||
# COPY --from=builder --chown=node /var/app /home/node/app |
|||
|
|||
# WORKDIR /home/node/app |
|||
|
|||
RUN npm config set registry=http://10.8.30.22:7000 |
|||
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|||
RUN npm cache clean -f |
|||
RUN rm -rf package-lock.json |
|||
RUN npm install --registry http://10.8.30.22:7000 |
|||
# CMD ["node", "server.js"] |
|||
|
|||
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 |
|||
|
|||
COPY --from=builder --chown=node /var/app /home/node/app |
|||
# 旧版本构建方式 |
|||
|
|||
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 |
|||
|
|||
COPY . /var/app |
|||
|
|||
WORKDIR /var/app |
|||
|
|||
EXPOSE 8080 |
|||
|
|||
WORKDIR /home/node/app |
|||
CMD ["-u", "http://localhost:8088"] |
|||
|
|||
CMD ["node", "server.js"] |
|||
ENTRYPOINT [ "node", "server.js" ] |
@ -0,0 +1,90 @@ |
|||
create table if not exists mirror |
|||
( |
|||
id serial not null, |
|||
template varchar(63) not null, |
|||
create_user integer not null, |
|||
create_time timestamp with time zone not null, |
|||
update_time timestamp with time zone, |
|||
title varchar(128), |
|||
show_header boolean not null, |
|||
publish boolean default false not null, |
|||
mid varchar(32) not null, |
|||
publish_time timestamp with time zone, |
|||
constraint mirror_pk |
|||
primary key (id) |
|||
); |
|||
|
|||
comment on column mirror.template is '模板标识'; |
|||
|
|||
create unique index if not exists mirror_id_uindex |
|||
on mirror (id); |
|||
|
|||
create table if not exists mirror_tree |
|||
( |
|||
id serial not null, |
|||
name varchar(64) not null, |
|||
level integer not null, |
|||
dependence integer, |
|||
mirror_id integer not null, |
|||
constraint mirror_tree_pk |
|||
primary key (id), |
|||
constraint mirror_tree_mirror_id_fk |
|||
foreign key (mirror_id) references mirror |
|||
); |
|||
|
|||
comment on table mirror_tree is '镜像服务的树节点'; |
|||
|
|||
comment on column mirror_tree.level is '层级标注'; |
|||
|
|||
create unique index if not exists mirror_tree_id_uindex |
|||
on mirror_tree (id); |
|||
|
|||
create table if not exists mirror_filter_group |
|||
( |
|||
id serial not null, |
|||
name varchar(64) not null, |
|||
forbidden boolean default false not null, |
|||
mirror_id integer not null, |
|||
constraint mirror_filter_group_pk |
|||
primary key (id), |
|||
constraint mirror_filter_group_mirror_id_fk |
|||
foreign key (mirror_id) references mirror |
|||
); |
|||
|
|||
comment on table mirror_filter_group is '筛选分组'; |
|||
|
|||
create unique index if not exists mirror_filter_group_id_uindex |
|||
on mirror_filter_group (id); |
|||
|
|||
create table if not exists mirror_filter |
|||
( |
|||
id serial not null, |
|||
name varchar(64) not null, |
|||
group_id integer not null, |
|||
constraint mirror_filter_pk |
|||
primary key (id), |
|||
constraint mirror_filter_mirror_filter_group_id_fk |
|||
foreign key (group_id) references mirror_filter_group |
|||
); |
|||
|
|||
create unique index if not exists mirror_filter_id_uindex |
|||
on mirror_filter (id); |
|||
|
|||
create table if not exists mirror_camera |
|||
( |
|||
id serial not null, |
|||
camera_id integer not null, |
|||
tree_ids integer[] not null, |
|||
filter_ids integer[], |
|||
mirror_id integer not null, |
|||
constraint mirror_camera_pk |
|||
primary key (id), |
|||
constraint mirror_camera_camera_id_fk |
|||
foreign key (camera_id) references camera, |
|||
constraint mirror_camera_mirror_id_fk |
|||
foreign key (mirror_id) references mirror |
|||
); |
|||
|
|||
create unique index if not exists mirror_camera_id_uindex |
|||
on mirror_camera (id); |
|||
|
@ -1,24 +1,40 @@ |
|||
FROM repository.anxinyun.cn/devops/node:12-dev as builder |
|||
# FROM repository.anxinyun.cn/devops/node:12-dev as builder |
|||
|
|||
COPY . /var/app |
|||
# COPY . /var/app |
|||
|
|||
WORKDIR /var/app |
|||
# WORKDIR /var/app |
|||
|
|||
EXPOSE 8080 |
|||
# EXPOSE 8080 |
|||
|
|||
# RUN npm config set registry=http://10.8.30.22:7000 |
|||
# RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|||
# RUN npm cache clean -f |
|||
# RUN npm install --registry http://10.8.30.22:7000 |
|||
# RUN npm run build |
|||
# RUN rm -rf client/src |
|||
# RUN rm -rf node_modules |
|||
# RUN npm install --production --registry http://10.8.30.22:7000 |
|||
|
|||
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 |
|||
|
|||
# COPY --from=builder --chown=node /var/app /home/node/app |
|||
|
|||
# WORKDIR /home/node/app |
|||
|
|||
# CMD ["node", "server.js"] |
|||
|
|||
RUN npm config set registry=http://10.8.30.22:7000 |
|||
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|||
RUN npm cache clean -f |
|||
RUN npm install --registry http://10.8.30.22:7000 |
|||
RUN npm run build |
|||
RUN rm -rf client/src |
|||
RUN rm -rf node_modules |
|||
RUN npm install --production --registry http://10.8.30.22:7000 |
|||
|
|||
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 |
|||
# 就版本构建方式 |
|||
|
|||
COPY --from=builder --chown=node /var/app /home/node/app |
|||
|
|||
WORKDIR /home/node/app |
|||
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 |
|||
|
|||
COPY . /var/app |
|||
|
|||
WORKDIR /var/app |
|||
|
|||
EXPOSE 8080 |
|||
|
|||
CMD ["-u", "http://localhost:8088"] |
|||
|
|||
CMD ["node", "server.js"] |
|||
ENTRYPOINT [ "node", "server.js" ] |
Loading…
Reference in new issue