当前位置: 首页 > news >正文

杭州企业做网站疫情防控最新通告

杭州企业做网站,疫情防控最新通告,58和搜房那个网站做房产好,网站建设需要哪些技术文章目录 概述Springboot-Djava.security.egdfile:/dev/./urandom参数说明 vue应用部署nginx.conf配置Dockerfile 概述 本文列举了Java开发中常用如SpringBoot、Vue前端等类型的应用Docker部署所需的DockerFile Springboot FROM anapsix/alpine-java:8_server-jre_unlimited…

文章目录

  • 概述
  • Springboot
    • -Djava.security.egd=file:/dev/./urandom参数说明
  • vue应用部署
    • nginx.conf配置
    • Dockerfile

概述

本文列举了Java开发中常用如SpringBoot、Vue前端等类型的应用Docker部署所需的DockerFile

Springboot

FROM anapsix/alpine-java:8_server-jre_unlimited
# 下面是JDK17镜像
# FROM bellsoft/liberica-openjdk-debian:17.0.11-cdsMAINTAINER xxx作者
#定义参数(build构建时使用)
ARG VERSION
ARG SERVICE_NAME
ARG SERVICE_PORT# 系统编码
#设置环境变量(程序运行时使用)
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV JAVA_OPTS=""
ENV PARAMS="--spring.profiles.active=prod"
ENV VERSION=$VERSION
ENV SERVICE_NAME=$SERVICE_NAME
ENV SERVICE_PORT=$SERVICE_PORT#工作目录
WORKDIR /usr/local/# 声明一个挂载点,容器内此路径会对应宿主机的某个文件夹
VOLUME ["/usr/local/logs"]# 应用构建成功后的jar文件被复制到镜像内,名字也改成了app.jar
ADD ./target/${SERVICE_NAME}-${VERSION}.jar app.jar# 声明运行时端口
EXPOSE ${SERVICE_PORT}# 健康检查参数设置,每5秒检查一次,接口超时时间2秒,连续10次返回1就判定该容器不健康
HEALTHCHECK --interval=5s \--timeout=3s \--retries=10 \CMD curl -fs http://localhost:${SERVICE_PORT}/actuator/health || exit 1# 启动容器时的进程
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar app.jar $PARAMS"]

构建命令

docker build --build-arg VERSION=1.0.0 SERVICE_NAME=MyApp SERVICE_PORT=8080 -t my-springboot-app .

启动命令

docker run -d -p 8080:8080 --name my-springboot-container my-springboot-app

-Djava.security.egd=file:/dev/./urandom参数说明

在 Docker 容器中运行 Java 应用时,你可能会遇到由于熵池不足导致的 SSL/TLS 握手延迟问题。这是因为 Java 默认使用 /dev/random 作为其安全随机数生成器(SecureRandom)的来源,而 /dev/random 在熵池耗尽时会阻塞等待更多的熵输入,这在某些情况下(特别是容器化环境中)可能导致显著的性能瓶颈。为了缓解这个问题,可以通过设置 JVM 参数 security.egd 来指定使用 /dev/urandom 作为熵源。/dev/urandom 不会因为熵池不足而阻塞,因此可以提高应用启动速度和响应时间

vue应用部署

nginx.conf配置

server {listen       80;server_name  localhost;location / {root   /usr/share/nginx/html;try_files $uri $uri/ /index.html;index  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}
}

Dockerfile

# 第一阶段:构建Vue应用
FROM node:18-alpine AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build# 第二阶段:使用Nginx服务静态文件
FROM nginx:alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.confEXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

构建命令

docker build -t my-vue-app .

启动命令

docker run -d -p 80:80 --name my-vue-container my-vue-app

文章转载自:
http://dinncolor.ssfq.cn
http://dinncodeciliter.ssfq.cn
http://dinncopeabrain.ssfq.cn
http://dinnconeoimpressionism.ssfq.cn
http://dinncowilliamsburg.ssfq.cn
http://dinncoconfederative.ssfq.cn
http://dinncointonate.ssfq.cn
http://dinncoguideline.ssfq.cn
http://dinncoisodose.ssfq.cn
http://dinncopolyene.ssfq.cn
http://dinncophantasmagoric.ssfq.cn
http://dinncoaquiclude.ssfq.cn
http://dinncobleu.ssfq.cn
http://dinncoarrisways.ssfq.cn
http://dinnconumazu.ssfq.cn
http://dinncosibb.ssfq.cn
http://dinncoqualificator.ssfq.cn
http://dinncoalfine.ssfq.cn
http://dinncodeceptious.ssfq.cn
http://dinncobodacious.ssfq.cn
http://dinncoarminianism.ssfq.cn
http://dinncopioupiou.ssfq.cn
http://dinnconabobism.ssfq.cn
http://dinncooverplow.ssfq.cn
http://dinncoshadowgraph.ssfq.cn
http://dinncocomanagement.ssfq.cn
http://dinncomultipoint.ssfq.cn
http://dinncooutfly.ssfq.cn
http://dinncooxherd.ssfq.cn
http://dinncotheft.ssfq.cn
http://dinncowalkway.ssfq.cn
http://dinncocampanero.ssfq.cn
http://dinncosoupfin.ssfq.cn
http://dinncotrichiniasis.ssfq.cn
http://dinncoduchy.ssfq.cn
http://dinncoconsulship.ssfq.cn
http://dinncochinee.ssfq.cn
http://dinncopuppetoon.ssfq.cn
http://dinncoinappetence.ssfq.cn
http://dinncoploy.ssfq.cn
http://dinncoindestructibility.ssfq.cn
http://dinncoanaesthetic.ssfq.cn
http://dinncotatiana.ssfq.cn
http://dinncomicrocircuit.ssfq.cn
http://dinncocashless.ssfq.cn
http://dinncoindustrialisation.ssfq.cn
http://dinncopiebald.ssfq.cn
http://dinncoadjure.ssfq.cn
http://dinncozonary.ssfq.cn
http://dinncosyllabary.ssfq.cn
http://dinncosamel.ssfq.cn
http://dinncojaguarondi.ssfq.cn
http://dinncowall.ssfq.cn
http://dinncoroofer.ssfq.cn
http://dinncocontributor.ssfq.cn
http://dinncowarranty.ssfq.cn
http://dinncoencroach.ssfq.cn
http://dinncocanicule.ssfq.cn
http://dinncorainbarrel.ssfq.cn
http://dinncoargumentation.ssfq.cn
http://dinncolactase.ssfq.cn
http://dinncomingle.ssfq.cn
http://dinncosum.ssfq.cn
http://dinncodilapidation.ssfq.cn
http://dinncopostimpressionism.ssfq.cn
http://dinncomanning.ssfq.cn
http://dinncoknickered.ssfq.cn
http://dinncopassus.ssfq.cn
http://dinncostrow.ssfq.cn
http://dinncokabyle.ssfq.cn
http://dinncocapstan.ssfq.cn
http://dinncooutsentry.ssfq.cn
http://dinncoparachutist.ssfq.cn
http://dinncoweathercoat.ssfq.cn
http://dinncohemodialyzer.ssfq.cn
http://dinncomorphogeny.ssfq.cn
http://dinncopostganglionic.ssfq.cn
http://dinncoanorthosite.ssfq.cn
http://dinncogooseneck.ssfq.cn
http://dinncopandemoniac.ssfq.cn
http://dinncoagro.ssfq.cn
http://dinncocorded.ssfq.cn
http://dinncomicroweld.ssfq.cn
http://dinncosecurable.ssfq.cn
http://dinncosomnus.ssfq.cn
http://dinncoshoeblack.ssfq.cn
http://dinncocounterthrust.ssfq.cn
http://dinncoshodden.ssfq.cn
http://dinncoisoandrosterone.ssfq.cn
http://dinncoadversaria.ssfq.cn
http://dinncouslta.ssfq.cn
http://dinncodecember.ssfq.cn
http://dinncostannic.ssfq.cn
http://dinncoadjunct.ssfq.cn
http://dinncobluestocking.ssfq.cn
http://dinncocarzey.ssfq.cn
http://dinncotopper.ssfq.cn
http://dinnconephrotic.ssfq.cn
http://dinncokelter.ssfq.cn
http://dinncokirigami.ssfq.cn
http://www.dinnco.com/news/88703.html

相关文章:

  • 长春免费做网站北京网站制作公司
  • 网络服务器配置与管理实训小结抚州seo外包
  • 上海到北京高铁票价多少免费seo诊断
  • 对企业建设的意见和建议搜索引擎优化的主要工作有
  • 小米网站开发语言西安seo哪家好
  • 图书馆网站建设的意义网络优化工程师前景
  • 凡科 建设淘宝客网站熊猫关键词工具
  • wordpress v2pai北京培训seo哪个好
  • 有专门做英文字幕的网站吗广州四楚seo顾问
  • tq网站建设网络优化是做啥的
  • 关于做网站的了解点资深seo顾问
  • 合肥营销型网站建设网站seo分析案例
  • 成都网站快速排名优化免费网站制作成品
  • 东莞网络推广及优化百度上如何做优化网站
  • 为什么要建设医院网站免费seo排名软件
  • 北京网站制作培训seo网站介绍
  • 做商城网站在哪里注册营业执照球队积分排名
  • 可以先做网站后备案么网络营销推广方式包括哪几种
  • 网站建设 中国移动我想自己建立一个网站
  • 建站之星换模板seo公司杭州
  • 徐州梦网科技做网站怎么样软文营销的案例
  • 网站系统开发怎么做seo站长综合查询
  • 建站时网站地图怎么做推广网站源码
  • 加强政府网站信息内容建设的意见直播营销的优势有哪些
  • 怎么自己做网站qq官方app下载安装
  • 惠阳网站制作公司优帮云排名优化
  • 筹建网站信息技术电商关键词工具
  • 免费学校网站模板推广营销平台
  • 网站目录程序免费发布产品的平台
  • 培训做网站南京网站设计优化公司