docker部署vue项目

2021年4月27日 06:21 by wst

服务部署

本文主要总结怎么用docker部署vue项目。

直接上代码。

1. Dockerfile

FROM node:8.17.0
#定义时区参数
ENV TZ=Asia/Shanghai
# 设置编码
ENV LC_ALL C.UTF-8
#设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone

WORKDIR /usr/src/app
COPY debian.tsinghua.source.txt .
RUN cat /usr/src/app/debian.tsinghua.source.txt > /etc/apt/sources.list
RUN apt update && apt install nginx -y

ARG build_env
COPY package*.json ./
RUN npm install --registry=https://registry.npm.taobao.org
COPY . .
RUN npm run ${build_env} && cp -r dist/* /var/www/html && if [ "$build_env" = "build" ] ; \
    then cp nginx/default.conf /etc/nginx/conf.d/default.conf; \
    else cp nginx/default-test.conf /etc/nginx/conf.d/default.conf; fi

CMD ["nginx", "-g", "daemon off;"]

 

2. debian.tsinghua.source.txt

deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib

 

3. default.conf

server {
    listen       80;
    server_name  admin.xxx.com.cn;

    #charset koi8-r;
    access_log  /var/log/nginx/host.access.log;
    error_log  /var/log/nginx/error.log;

    location / {
        root   /var/www/html;
        try_files $uri $uri/ /index.html;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /var/www/html;
    }
}

default-test.conf 的内容同上,不同点为第三行:server_name admin-test.xxx.com.cn;

 

4. 对外暴露的端口可自行确定,如(17401):

docker build --build-arg build_env=build -t business-front .
docker rm -f business-f
docker run -itd  --name business-f -p 17401:80 business-front

 


Comments(129) Add Your Comment

Charlesnag
“I haven’t seen you in these parts,” the barkeep said, sidling during to where I sat. “Personage’s Bao.” He stated it exuberantly, as if word of his exploits were shared aside settlers about many a ‚lan in Aeternum. He waved to a unimpassioned hogshead hard by us, and I returned his gesture with a nod. He filled a eyeglasses and slid it to me across the stained red wood of the court before continuing. “As a betting fellow, I’d be willing to wager a adequate piece of silver you’re in Ebonscale Reach for more than the wet one's whistle and sights,” he said, eyes glancing from the sword sheathed on my in to the salaam slung across my back. http://www.google.com.bd/url?q=https://renewworld.ru/sistemnye-trebovaniya-new-world/
Kevingaw
https://www.stadt-berga.de/wp-includes/pgs/?welches_casino_zahlt_am_schnellsten_aus____top_5_online_casinos_mit_guter_rendite_2022.html http://maps.google.vu/url?q=https://1xbitapk.com/hi/ https://www.kraxe-test.de/pag/mit_online_casinos_geld_verdienen_.html https://www.google.be/url?q=http://cloudbetwelcomebonus.com/de/ http://www.google.ml/url?q=http://sportsbetapk.com/es/
Kevingaw
http://audium.com/img/pages/welche_casinos_gewinnen_wirklich_2022__bewertungen_von_spielern__die_geld_abheben__ohne_zu_betr_gen.html http://justinekeptcalmandwentvegan.com/wp-content/pages/welches_online_casino_ist_zu_empfehlen___online_casinos_mit_guter_rendite_2022_.html https://www.google.ch/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CDsQtwIwAg&url=https://1xbitapk.com/fr/ http://www.google.ru/url?sa=i&rct=j&esrc=s&frm=1&source=images&docid=w-1zau2en7TDrM&tbnid=a03a-Ff_C5rs0M:&ved=0CAUQjRw&url=https://1xbitapk.com/ko/ https://www.merkur-zeitschrift.de/wp-content/pages/die_besten_casinos_in_las_vegas_auf_dem_strip.html
Jbkdzq
purchase atorvastatin <a href="https://lipiws.top/">brand lipitor 40mg</a> cheap lipitor
Wkqkec
buy cipro 500mg generic - <a href="https://metroagyl.top/">buy ciprofloxacin pill</a> augmentin 375mg brand
Nyxtkn
buy cipro 1000mg pills - <a href="https://cipropro.top/keflexcapsule/">keflex 500mg uk</a> clavulanate ca
Oljseo
order metronidazole 400mg pills - <a href="https://metroagyl.top/">order metronidazole 400mg pill</a> zithromax 250mg drug
Gbmtai
buy ciplox 500mg without prescription - <a href="https://septrim.top/erythromycin/">cost erythromycin</a> order erythromycin 250mg generic
Alwdgr
valacyclovir price - <a href="https://gnantiviralp.com/zovirax/">order acyclovir 400mg generic</a> acyclovir us
Lfjnkw
ivermectin 3 mg over counter - <a href="https://keflexin.top/cefixime/">cefixime tablet</a> tetracycline 500mg cheap
Mlpsum
flagyl us - <a href="https://metroagyl.top/keflexcapsule/">amoxil without prescription</a> zithromax 500mg sale
Xmkclj
order <a href="https://ampiacil.top/doxycyclineantb/">purchase monodox without prescription</a> buy amoxicillin paypal
Qculkz
order lasix 100mg - <a href="https://antipathogenc.com/atacand/">buy candesartan 8mg online cheap</a> buy capoten 25mg online cheap
Usundk
order zidovudine for sale - <a href="https://canadiangnp.com/rulide/">roxithromycin 150mg us</a> where can i buy allopurinol
Ohjkfp
order metformin pill - <a href="https://gnantiacidity.com/duricef/">generic cefadroxil 500mg</a> buy lincomycin 500mg for sale
Vvytlt
order clozaril 100mg for sale - <a href="https://genonlinep.com/accupril/">order quinapril generic</a> pepcid ca
Oqtohu
brand seroquel 100mg - <a href="https://gnkantdepres.com/eskalith/">eskalith ca</a> cheap eskalith online
Voclyh
order atarax 10mg sale - <a href="https://antdepls.com/endep/">purchase endep sale</a> buy endep paypal
Xpvpvb
clomipramine for sale online - <a href="https://antdeponline.com/tofranil/">tofranil pills</a> buy doxepin without a prescription
Oihkhh
amoxil us - <a href="https://atbioxotc.com/">amoxil online order</a> cipro 500mg pills
Totqxx
brand augmentin 375mg - <a href="https://atbioinfo.com/ethambutol/">buy myambutol paypal</a> cipro 1000mg usa
Rmhkyv
where to buy clindamycin without a prescription - <a href="https://cadbiot.com/oxytetracycline/">oxytetracycline 250mg sale</a> cheap chloromycetin generic
Oscjdm
oral zithromax 500mg - <a href="https://gncatbp.com/ctinidazole/">order tinidazole 300mg</a> ciprofloxacin 500 mg us
Gbohti
ventolin inhalator generic - <a href="https://antxallergic.com/advairdiskus/">buy fluticasone generic</a> theophylline 400mg cost
Dqggfj
can you buy stromectol over the counter - <a href="https://antibpl.com/rferyc/">eryc 250mg drug</a> cefaclor online buy
Rsgoqw
order clarinex 5mg generic - <a href="https://rxtallerg.com/getaristocort/">buy aristocort 10mg</a> ventolin 2mg cost
Kuubpg
medrol cost in usa - <a href="https://ntallegpl.com/getcetirizine/">buy cetirizine tablets</a> azelastine 10ml cheap
Jykqqc
micronase 5mg tablet - <a href="https://prodeprpl.com/pioglitazone30/">order pioglitazone 15mg online</a> forxiga 10 mg for sale
Nvpalc
buy prandin generic - <a href="https://depressinfo.com/jardiance25/">brand jardiance 25mg</a> buy jardiance 10mg online cheap
Oocqxl
order glucophage 1000mg generic - <a href="https://arxdepress.com/acarbose50/">order acarbose for sale</a> purchase precose online cheap
Fcicif
brand lamisil - <a href="https://treatfungusx.com/adiflucanv/">buy diflucan 100mg online</a> grifulvin v oral
Zgohiw
rybelsus 14 mg sale - <a href="https://infodeppl.com/ddavpspray/">purchase DDAVP online</a> purchase desmopressin for sale
Kyasfw
buy ketoconazole medication - <a href="https://antifungusrp.com/butenafinecream/">mentax brand</a> sporanox where to buy
Rliwar
buy digoxin 250mg without prescription - <a href="https://blpressureok.com/dipyridamole100/">dipyridamole 100mg pill</a> buy lasix paypal
Wlorao
famciclovir 500mg sale - <a href="https://amvinherpes.com/">famvir 500mg without prescription</a> buy valaciclovir for sale
Lhqdue
generic hydrochlorothiazide 25mg - <a href="https://norvapril.com/bisoprolol/">zebeta price</a> buy bisoprolol generic
Bbppxw
lopressor tablet - <a href="https://bloodpresspl.com/hyzaar/">buy cozaar 25mg sale</a> purchase nifedipine for sale
Hrhrba
order nitroglycerin online - <a href="https://nitroproxl.com/catapres/">purchase clonidine pills</a> diovan 160mg oral
Fzamvv
crestor over - <a href="https://antcholesterol.com/">rosuvastatin pills noise</a> caduet tournament
Syoylg
order generic zocor 20mg - <a href="https://canescholest.com/fenofibrate/">tricor escape</a> lipitor flash
Bbkzla
viagra professional online shallow - <a href="https://edsildps.com/malegra/">malegra arrow</a> levitra oral jelly online stride
Yoyjad
cenforce appeal - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra beckon</a> brand viagra pills investigation
Zrhhol
priligy pop - <a href="https://promedprili.com/viagraplus/">viagra plus cloak</a> cialis with dapoxetine pilot
Demzzz
brand cialis whip - <a href="https://probrandtad.com/tadorapills/">tadora someone</a> penisole develop
Efrrih
cialis soft tabs pills block - <a href="https://supervalip.com/levitrasoft/">levitra soft superior</a> viagra oral jelly bid
Svynmn
brand cialis disease - <a href="https://probrandtad.com/">brand cialis pig</a> penisole nearest
Zkbtsm
cialis soft tabs pills okay - <a href="https://supervalip.com/">cialis soft tabs pills scrap</a> viagra oral jelly online monsieur
Cwiqnv
cenforce nail - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra pills anything</a> brand viagra online dust
Rndblx
acne treatment sad - <a href="https://placnemedx.com/">acne treatment glint</a> acne medication hey
Vutrzu
asthma treatment subject - <a href="https://bsasthmaps.com/">asthma medication body</a> inhalers for asthma apprehension
Bvinte
uti antibiotics hill - <a href="https://amenahealthp.com/">uti medication nay</a> uti medication shallow
Owikth
prostatitis treatment blank - <a href="https://xprosttreat.com/">pills for treat prostatitis estate</a> prostatitis medications night
Vkbpba
valacyclovir pills across - <a href="https://gnantiviralp.com/">valtrex online stomach</a> valacyclovir pills altogether
Wbxtgn
claritin pills hang - <a href="https://clatadine.top/">claritin assemble</a> claritin wink
Btiqjf
claritin mr - <a href="https://clatadine.top/">claritin pills fifty</a> loratadine medication troop
Kuxxeg
priligy lover - <a href="https://prilixgn.top/">priligy victim</a> priligy accurate
Srthid
promethazine distress - <a href="https://prohnrg.com/">promethazine bury</a> promethazine librarian
Wkejtt
ascorbic acid amidst - <a href="https://ascxacid.com/">ascorbic acid resolution</a> ascorbic acid alone
Jaspjt
fludrocortisone inch - <a href="https://gastroplusp.com/omepprilosec/">omeprazole hedge</a> lansoprazole pills astonish
Xsbrkr
biaxin pills other - <a href="https://gastropls.com/mesalaminepl/">asacol unpleasant</a> cytotec pair
Drmphq
bisacodyl 5mg drug - <a href="https://gastroinfop.com/oxybutynin/">oxybutynin buy online</a> liv52 20mg generic
Wshujg
aciphex 10mg over the counter - <a href="https://gastrointesl.com/domperidone/">order motilium generic</a> order motilium pill
Xpmdsz
cotrimoxazole over the counter - <a href="https://ketiracet.com/">keppra pills</a> tobramycin sale
Mjhssm
purchase eukroma without prescription - <a href="https://dupsteron.com/">where to buy dydrogesterone without a prescription</a> buy dydrogesterone 10mg sale
Mjaoxf
dapagliflozin 10 mg pill - <a href="https://precarbos.com/">order acarbose generic</a> acarbose 50mg over the counter
Luanqh
purchase griseofulvin for sale - <a href="https://fulviseoful.com/">griseofulvin usa</a> brand gemfibrozil 300 mg
Ylcxsb
brand enalapril 10mg - <a href="https://xalanoprost.com/">purchase zovirax without prescription</a> oral xalatan
Ewovqv
dimenhydrinate buy online - <a href="https://bisacolax.com/">pill dramamine 50mg</a> actonel online buy
Ruikud
buy piroxicam generic - <a href="https://rivastilons.com/">order exelon 6mg for sale</a> buy exelon 6mg without prescription
Yatsrq
buy monograph generic - <a href="https://etodograph.com/">order etodolac 600 mg generic</a> pletal 100 mg usa
Waqrbi
order hydrea without prescription - <a href="https://hydroydrinfo.com/disulfiram/">antabuse 500mg us</a> where to buy robaxin without a prescription
Eanjaf
where to buy nootropil without a prescription - <a href="https://nootquin.com/efavirenz/">sustiva 20mg pill</a> cheap sinemet 20mg
Esuhvl
cheap norpace tablets - <a href="https://anorpica.com/chlorpromazine/">buy generic thorazine over the counter</a> chlorpromazine 50 mg us
Wvvofc
buy divalproex generic - <a href="https://adepamox.com/amiodarone/">buy cordarone 200mg</a> generic topiramate 200mg
Kpcpyf
buy cyclophosphamide cheap - <a href="https://cycloxalp.com/">buy generic cytoxan for sale</a> order vastarel generic
Lbbsfp
spironolactone 25mg without prescription - <a href="https://aldantinep.com/naltrexone/">order naltrexone 50mg pill</a> naltrexone 50mg cheap
Yzvgjd
order zofran pill - <a href="https://azofarininfo.com/tolterodine/">buy tolterodine 2mg generic</a> order requip sale
Oazlzj
flexeril canada - <a href="https://abflequine.com/olanzapine/">order zyprexa generic</a> order vasotec 5mg for sale
Wlvgga
order ascorbic acid 500mg sale - <a href="https://mdacidinfo.com/">order ascorbic acid pill</a> prochlorperazine for sale online
Jszrxq
where can i purchase durex gel - <a href="https://xalaplinfo.com/">durex gel order online</a> zovirax canada
Xgkmwn
order leflunomide sale - <a href="https://infohealthybones.com/risedronate/">risedronate 35mg pills</a> order cartidin sale
Drlldm
order rogaine online cheap - <a href="https://mdacidinfo.com/dutasteride/">dutas online order</a> buy generic finasteride over the counter
Dcfxjf
tenormin pills - <a href="https://heartmedinfox.com/">buy atenolol 100mg for sale</a> buy carvedilol 6.25mg online
Dmquuc
buy verapamil 120mg sale - <a href="https://infoheartdisea.com/cardizem/">how to buy diltiazem</a> cheap tenoretic tablets
Vcznuk
buy generic atorlip online - <a href="https://infoxheartmed.com/nebivolol/">buy bystolic paypal</a> brand nebivolol 5mg
Zwforz
lasuna oral - <a href="https://infoherbalmz.com/himcolin/">order himcolin generic</a> oral himcolin
Stwtjf
purchase gasex generic - <a href="https://herbalinfomez.com/diabecon/">diabecon online</a> buy diabecon without a prescription
Xlvxrm
cheap speman pill - <a href="https://spmensht.com/himplasia/">generic himplasia</a> purchase finasteride generic
Sbyckm
norfloxacin pills - <a href="https://gmenshth.com/flutamide/">eulexin over the counter</a> buy confido without prescription
Bfnrkx
finax tablets - <a href="https://finmenura.com/">buy finasteride tablets</a> uroxatral 10mg uk
Lwrycc
buy hytrin 5mg sale - <a href="https://hymenmax.com/dutasteride/">avodart 0.5mg ca</a> buy priligy 90mg pills
Etrufx
buy lactulose for sale - <a href="https://duphalinfo.com/betahistine/">order betahistine 16 mg generic</a> betahistine 16mg sale
Roclon
oxcarbazepine medication - <a href="https://trileoxine.com/">where to buy oxcarbazepine without a prescription</a> buy levothroid pills
Hnpydv
imusporin uk - <a href="https://asimusxate.com/methotrexate/">buy methotrexate 10mg without prescription</a> oral colcrys
Mtakyp
deflazacort over the counter - <a href="https://lazacort.com/brimonidine/">alphagan eye drops</a> purchase alphagan for sale
Dfpznn
besifloxacin order online - <a href="https://besifxcist.com/carbocysteine/">carbocisteine online buy</a> where to buy sildamax without a prescription
Axyhex
buy neurontin 100mg generic - <a href="https://aneutrin.com/">purchase gabapentin sale</a> buy sulfasalazine 500 mg generic
Ukghdk
buy generic probenecid for sale - <a href="https://bendoltol.com/carbamazepine/">carbamazepine oral</a> carbamazepine 200mg cheap
Ekhkra
buy celecoxib 200mg without prescription - <a href="https://celespas.com/flavoxate/">cheap flavoxate online</a> indocin 75mg canada
Puvrkf
colospa 135mg sale - <a href="https://coloxia.com/">buy mebeverine 135 mg for sale</a> order pletal
Gusujs
order voltaren 50mg online cheap - <a href="https://dicloltarin.com/aspirin/">aspirin 75 mg price</a> aspirin 75 mg ca
Smmpcm
rumalaya brand - <a href="https://rumaxtol.com/amitriptyline/">endep where to buy</a> buy amitriptyline 50mg online cheap
Cwauve
buy mestinon medication - <a href="https://mestonsx.com/asumatriptan/">how to buy imitrex</a> azathioprine 50mg oral
Glvsgi
buy voveran generic - <a href="https://vovetosa.com/">buy voveran generic</a> buy generic nimotop over the counter
Xrorlw
baclofen over the counter - <a href="https://baclion.com/nspiroxicam/">piroxicam where to buy</a> piroxicam ca
Geyxcx
buy mobic without prescription - <a href="https://meloxiptan.com/asrizatriptan/">maxalt 10mg brand</a> buy toradol cheap
Blbdmt
buy cyproheptadine 4 mg - <a href="https://periheptadn.com/">order periactin generic</a> buy tizanidine pill
Ufarlj
generic artane - <a href="https://voltapll.com/diclofenacgel/">buy diclofenac gel sale</a> buy emulgel for sale
Ilmshm
purchase accutane pills - <a href="https://aisotane.com/asavlosulfon/">dapsone 100 mg generic</a> purchase deltasone pill
Jmtnqj
prednisone 20mg brand - <a href="https://apreplson.com/">order prednisone 10mg without prescription</a> buy generic elimite over the counter
Ydfhby
permethrin cream - <a href="https://actizacs.com/">acticin oral</a> buy generic retin online
Dnhail
purchase betamethasone for sale - <a href="https://betnoson.com/">generic betamethasone</a> buy benoquin online cheap
Jmvjba
buy metronidazole paypal - <a href="https://cenforcevs.com/">buy cenforce 100mg for sale</a> cenforce 50mg tablet
Bxdbxd
order augmentin 1000mg generic - <a href="https://alevonted.com/">cheap levoxyl</a> buy synthroid 100mcg pills
Olmosn
order cleocin sale - <a href="https://clinycinpl.com/">order cleocin pills</a> indomethacin 75mg brand
Ghmxha
losartan buy online - <a href="https://acephacrsa.com/">purchase cephalexin</a> buy keflex 125mg online cheap
Madbcc
cheap eurax - <a href="https://aeuracream.com/abactroban/">purchase mupirocin sale</a> order aczone gel
Faasak
buy modafinil no prescription - <a href="https://sleepagil.com/">order modafinil 200mg sale</a> purchase melatonin for sale
Lurnpl
bupropion 150mg ca - <a href="https://bupropsl.com/orlistat/">buy xenical sale</a> where can i buy shuddha guggulu
Fwrywe
capecitabine 500 mg cheap - <a href="https://xelocap.com/danocrine/">danazol capsules</a> danazol tablet
Bpugyq
prometrium 100mg canada - <a href="https://apromid.com/gynelotrimin/">buy ponstel online</a> order clomiphene for sale
Zxbduw
buy alendronate 35mg sale - <a href="https://pilaxmax.com/tamoxifen/">cost tamoxifen 20mg</a> order provera without prescription
Wzvyhu
order norethindrone 5 mg without prescription - <a href="https://norethgep.com/bimatoprost/">buy lumigan sale</a> yasmin order online
Slqxqt
buy dostinex 0.25mg - <a href="https://adostilin.com/">order dostinex 0.25mg online</a> alesse canada
Nubjit
brand estradiol 2mg - <a href="https://festrolp.com/letrozole/">buy generic femara online</a> anastrozole 1mg pills
Hjbujb
バイアグラ 個人輸入 おすすめ - <a href="https://jpedpharm.com/tadalafil/">シアリス 海外通販</a> シアリスは薬局で買える?
Jlrrbc
プレドニン通販 安全 - <a href="https://jpaonlinep.com/">正規品プレドニン錠の正しい処方</a> ジスロマック通販 安全
Hydnhu
プレドニン錠 40 mg 強さ - <a href="https://jpanfarap.com/jpaaccutane/">アキュテイン処方</a> 正規品アキュテイン錠の正しい処方
Famqpm
eriacta amongst - <a href="https://eriagra.com/asildigrah/">sildigra huddle</a> forzest rattle