基于Docker用nginx部署vue项目

2020年4月13日 13:12 by wst

node

Docker部署vue项目

前奏

开发完node程序之后,如果想部署,有很多种方法,比如:

1. 编译之后,把生成的dist用nginx部署;

2.或者直接在Docker中部署;

 

理想的方法

直接在Docker中编译并直接部署,为了实现这个效果需要先拉取node镜像,然后安装nginx服务,并启动。

完整的Dockerfile文件如下:

FROM node:8.17.0
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

COPY package*.json ./
RUN npm install --registry=https://registry.npm.taobao.org
COPY . .
RUN npm run build:prod && cp -r dist/* /usr/share/nginx/html/ && cp nginx/default.conf /etc/nginx/conf.d/default.conf

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

 

依赖文件:

nginx/default.conf -- nginx配置文件, 请根据自己的情况进行修改

server {
    listen       80;
    server_name  localhost;

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

    location / {
        root   /usr/share/nginx/html;
        try_files $uri $uri/ /index.html;
        # index  index.html index.htm;
    }

    location /nyg/ {
        rewrite /nyg/(.*) /nyg/$1 break;
        proxy_pass http://jh-api.bigdata.infinities.com.cn;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

debian.tsinghua.source.txt -- 使用163的源安装nginx更快

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

package*.json -- 配置文件

说明: 这些package开头的文件为vue项目创建和构建时自动生成的文件.

 


Comments(125) Add Your Comment

Charlesnag
“I haven’t seen you in these parts,” the barkeep said, sidling over and above to where I sat. “Personage’s Bao.” He stated it exuberantly, as if word of his exploits were shared by means of settlers about assorted a ‚lan in Aeternum. He waved to a unimpassioned butt upset 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 bench prior to continuing. “As a betting houseman, I’d be ready to wager a adequate portion of coin you’re in Ebonscale Reach for more than the swig and sights,” he said, eyes glancing from the sword sheathed on my hip to the bend slung across my back. https://www.google.com.sv/url?q=https://renewworld.ru/new-world-kak-popast-na-alfa-i-beta-testy/
Qgitbb
order lipitor 20mg generic <a href="https://lipiws.top/">cheap lipitor 20mg</a> buy generic atorvastatin over the counter
Tttcmt
ciprofloxacin online order - <a href="https://cipropro.top/augmentin500/">buy cheap augmentin</a> buy augmentin tablets
Ulgyij
order generic ciprofloxacin 1000mg - <a href="https://metroagyl.top/cefaclor/">cephalexin for sale online</a> augmentin 1000mg us
Fopvyl
ciprofloxacin 500mg uk - <a href="https://septrim.top/tinidazole/">purchase tindamax generic</a> order erythromycin online cheap
Bdodny
order metronidazole 400mg sale - <a href="https://metroagyl.top/keflexcapsule/">order amoxicillin sale</a> buy azithromycin without a prescription
Rtogrl
ivermectin 6mg stromectol - <a href="https://keflexin.top/ceftin/">buy ceftin 500mg online cheap</a> purchase tetracycline online
Zacxuc
buy cheap valacyclovir - <a href="https://gnantiviralp.com/starlix/">where can i buy nateglinide</a> buy zovirax 800mg without prescription
Lzogps
ampicillin us <a href="https://ampiacil.top/penicillinused/">buy penicillin without prescription</a> cheap amoxil generic
Eylshz
flagyl 400mg uk - <a href="https://metroagyl.top/oxytetracycline/">order terramycin pills</a> buy zithromax 250mg pills
Nhpiyo
buy furosemide no prescription - <a href="https://antipathogenc.com/atacand/">buy candesartan online cheap</a> capoten usa
Zvdfdf
metformin over the counter - <a href="https://gnantiacidity.com/baycip/">purchase ciprofloxacin pills</a> buy lincocin without a prescription
Tntfhi
zidovudine tubes - <a href="https://canadiangnp.com/avapro/">order generic avapro 150mg</a> buy zyloprim no prescription
Dnzcdh
cheap clozapine 50mg - <a href="https://genonlinep.com/pepcid/">pepcid for sale</a> famotidine online buy
Qfjuss
quetiapine 50mg pill - <a href="https://gnkantdepres.com/geodon/">buy generic geodon for sale</a> buy eskalith cheap
Rqicji
brand anafranil 50mg - <a href="https://antdeponline.com/paxil/">buy generic paxil 20mg</a> buy cheap doxepin
Ajkgir
hydroxyzine 10mg without prescription - <a href="https://antdepls.com/endep/">buy cheap generic amitriptyline</a> buy generic endep
Qcfjek
purchase amoxiclav pills - <a href="https://atbioinfo.com/ampicillin/">cheap acillin</a> buy ciprofloxacin generic
Rvufkt
buy amoxil generic - <a href="https://atbioxotc.com/erythromycin/">order erythromycin generic</a> buy ciprofloxacin 1000mg without prescription
Gvleap
azithromycin 500mg price - <a href="https://gncatbp.com/btetracycline/">sumycin 250mg usa</a> buy ciprofloxacin 500mg
Inlkmn
clindamycin drug - <a href="https://cadbiot.com/">buy cleocin 300mg pills</a> buy chloromycetin sale
Kwzwpg
stromectol tablets for humans - <a href="https://antibpl.com/tylquin/">buy levofloxacin 250mg generic</a> cefaclor 250mg oral
Dlkeiz
albuterol us - <a href="https://antxallergic.com/advairdiskus/">buy cheap generic fluticasone</a> cost theophylline
Cohqxv
depo-medrol online order - <a href="https://ntallegpl.com/getcetirizine/">buy cetirizine 10mg generic</a> order azelastine 10 ml online cheap
Yrukpu
buy desloratadine pills - <a href="https://rxtallerg.com/ventolinpill/">albuterol cost</a> buy ventolin pill
Hmrtdt
order micronase without prescription - <a href="https://prodeprpl.com/dapagliflozin5/">order forxiga 10mg for sale</a> generic dapagliflozin
Oixmjw
metformin online - <a href="https://arxdepress.com/losartan25/">hyzaar online</a> purchase acarbose online cheap
Bjdlii
buy prandin paypal - <a href="https://depressinfo.com/">order prandin 2mg for sale</a> jardiance buy online
Tekqzf
buy semaglutide 14mg generic - <a href="https://infodeppl.com/">rybelsus 14mg oral</a> desmopressin generic
Mjtbtb
lamisil us - <a href="https://treatfungusx.com/adiflucanv/">diflucan 200mg cost</a> buy generic griseofulvin over the counter
Zdjxys
nizoral 200mg oral - <a href="https://antifungusrp.com/itraconazole100/">itraconazole price</a> buy itraconazole 100 mg online cheap
Yubluk
famciclovir pill - <a href="https://amvinherpes.com/">buy famciclovir 250mg generic</a> valaciclovir cheap
Yfupsu
lanoxin 250 mg canada - <a href="https://blpressureok.com/isoptinpillmg/">buy calan 120mg generic</a> order lasix 40mg generic
Kcvbqw
purchase lopressor online - <a href="https://bloodpresspl.com/">buy metoprolol without prescription</a> purchase adalat generic
Oggkah
order hydrochlorothiazide 25mg for sale - <a href="https://norvapril.com/lisinopril/">zestril 10mg generic</a> order zebeta 10mg generic
Ugeovy
buy generic nitroglycerin over the counter - <a href="https://nitroproxl.com/catapres/">catapres 0.1mg usa</a> valsartan for sale online
Cdosbm
simvastatin forehead - <a href="https://canescholest.com/">zocor reserve</a> lipitor ridiculous
Kriiti
crestor license - <a href="https://antcholesterol.com/">crestor response</a> caduet online worth
Euazhb
viagra professional back - <a href="https://edsildps.com/malegra/">malegra shower</a> levitra oral jelly online morrow
Tigmhv
dapoxetine plate - <a href="https://promedprili.com/viagraplus/">viagra plus encourage</a> cialis with dapoxetine soft
Qojdhh
cenforce online weapon - <a href="https://xcenforcem.com/cialistadalafil/">tadalafil cialis</a> brand viagra pills waiter
Jglxsk
brand cialis period - <a href="https://probrandtad.com/">brand cialis short</a> penisole considerable
Hrmurl
brand cialis grand - <a href="https://probrandtad.com/apcalissx/">apcalis picture</a> penisole doubtful
Ftaovp
cialis soft tabs pills joe - <a href="https://supervalip.com/">cialis soft tabs pills carpet</a> viagra oral jelly okay
Tdsrtj
cialis soft tabs pills peep - <a href="https://supervalip.com/levitrasoft/">levitra soft online few</a> viagra oral jelly online service
Nuigsq
cenforce online engine - <a href="https://xcenforcem.com/tadaciptadalafil/">tadacip pills accident</a> brand viagra mill
Envqrh
inhalers for asthma hiss - <a href="https://bsasthmaps.com/">asthma treatment sick</a> asthma treatment suspicion
Ftaorv
acne medication course - <a href="https://placnemedx.com/">acne medication sheet</a> acne treatment season
Cmasco
prostatitis treatment accompany - <a href="https://xprosttreat.com/">prostatitis treatment absolute</a> prostatitis treatment sea
Lzkdrp
uti antibiotics drag - <a href="https://amenahealthp.com/">uti antibiotics unlock</a> uti antibiotics galaxy
Asydrv
claritin pills interview - <a href="https://clatadine.top/">claritin pills incline</a> claritin pills first
Czfpxz
valacyclovir pills whenever - <a href="https://gnantiviralp.com/">valacyclovir pills steep</a> valacyclovir online place
Gjkvpi
dapoxetine gather - <a href="https://prilixgn.top/">priligy kid</a> priligy desire
Tbyxra
claritin pills sweeper - <a href="https://clatadine.top/">loratadine medication affair</a> claritin pills farm
Almemv
ascorbic acid sea - <a href="https://ascxacid.com/">ascorbic acid meal</a> ascorbic acid suggest
Mczytp
promethazine acquaint - <a href="https://prohnrg.com/">promethazine bark</a> promethazine hurried
Lyptjn
biaxin pills powder - <a href="https://gastropls.com/ranitidineonline/">ranitidine pills nail</a> cytotec pills brass
Qsqkuh
fludrocortisone mingle - <a href="https://gastroplusp.com/omepprilosec/">omeprazole pills bath</a> lansoprazole pills august
Pxjmlb
order rabeprazole sale - <a href="https://gastrointesl.com/metoclopramide/">order metoclopramide 20mg generic</a> purchase domperidone pill
Yqbghn
dulcolax 5 mg cost - <a href="https://gastroinfop.com/loperamide/">order loperamide 2 mg</a> liv52 10mg for sale
Wcnlel
purchase zovirax for sale - <a href="https://danaterone.shop/">order generic hydroquinone</a> order generic duphaston 10 mg
Vhcrmn
bactrim 480mg brand - <a href="https://tobmycin.com/">order tobramycin</a> buy tobramycin 5mg
Howcts
buy generic fulvicin over the counter - <a href="https://gemfilopi.com/">buy gemfibrozil 300 mg generic</a> buy gemfibrozil 300mg without prescription
Sqzzch
order forxiga 10 mg online cheap - <a href="https://forpaglif.com/">dapagliflozin 10 mg pill</a> acarbose where to buy
Lletlm
dramamine sale - <a href="https://actodronate.com/">actonel 35mg generic</a> generic risedronate
Yuphcy
buy enalapril no prescription - <a href="https://doxapisin.com/">buy doxazosin pills</a> zovirax where to buy
Ailbci
buy monograph 600 mg pills - <a href="https://cilosetal.com/">buy cilostazol medication</a> cilostazol us
Ukddtm
piroxicam cheap - <a href="https://feldexicam.com/">buy feldene 20mg generic</a> exelon 6mg brand
Xgfxwt
how to get piracetam without a prescription - <a href="https://nootquin.com/secnidazole/">buy secnidazole pills</a> order sinemet pills
Oddrnf
hydroxyurea for sale - <a href="https://hydroydrinfo.com/methocarbamol/">buy robaxin pill</a> buy generic methocarbamol for sale
Kmjdwe
divalproex for sale - <a href="https://adepamox.com/amiodarone/">order cordarone 100mg online cheap</a> order topiramate 200mg sale
Nixirl
norpace oral - <a href="https://anorpica.com/chlorpromazine/">buy generic chlorpromazine 100mg</a> buy thorazine 100mg without prescription
Cwzgxo
spironolactone 100mg over the counter - <a href="https://aldantinep.com/carbamazepine/">epitol order online</a> buy naltrexone pill
Jnpanc
buy cytoxan generic - <a href="https://cycloxalp.com/stavudine/">buy zerit pills for sale</a> buy trimetazidine for sale
Vkpkiq
buy cyclobenzaprine 15mg online cheap - <a href="https://abflequine.com/enalapril/">order enalapril 5mg for sale</a> enalapril 5mg pills
Lbyckq
zofran pill - <a href="https://azofarininfo.com/oxybutynin/">cheap generic oxybutynin</a> ropinirole 1mg brand
Gboeqc
ascorbic acid ca - <a href="https://mdacidinfo.com/isosorbidedinitrate/">buy isosorbide dinitrate</a> compro online order
Heotfn
buy durex gel cheap - <a href="https://xalaplinfo.com/">buy durex gel sale</a> where to buy latanoprost without a prescription
Pjddme
purchase minoxidil online - <a href="https://mdacidinfo.com/dutasteride/">where can i buy dutas</a> oral proscar 1mg
Tcgxfb
leflunomide 20mg price - <a href="https://infohealthybones.com/risedronate/">purchase risedronate online</a> buy cheap cartidin
Jclwid
buy calan pill - <a href="https://infoheartdisea.com/">order verapamil 120mg online</a> tenoretic for sale online
Nxtqxg
tenormin cheap - <a href="https://heartmedinfox.com/">buy atenolol 100mg</a> carvedilol online order
Maoffv
buy atorlip no prescription - <a href="https://infoxheartmed.com/lisinopril/">order zestril online cheap</a> generic bystolic
Yacrmg
purchase gasex for sale - <a href="https://herbalinfomez.com/diabecon/">diabecon oral</a> purchase diabecon sale
Kxwqlp
noroxin oral - <a href="https://gmenshth.com/flutamide/">order eulexin generic</a> buy generic confido for sale
Bcyltn
speman over the counter - <a href="https://spmensht.com/finasteride/">finasteride online order</a> buy generic finasteride
Qwifhx
buy finasteride online cheap - <a href="https://finmenura.com/kamagra/">buy sildenafil 200mg for sale</a> alfuzosin uk
Sxsdvi
terazosin 1mg drug - <a href="https://hymenmax.com/dapoxetine/">buy dapoxetine without prescription</a> generic dapoxetine 60mg
Icehyj
order oxcarbazepine 300mg - <a href="https://trileoxine.com/pirfenidone/">purchase pirfenidone online cheap</a> synthroid 100mcg price
Jzjogo
buy generic imusporin - <a href="https://asimusxate.com/methotrexate/">methotrexate 10mg cheap</a> colcrys for sale
Cmoklc
buy duphalac bottless - <a href="https://duphalinfo.com/betahistine/">cheap betahistine</a> betahistine cheap
Dtywba
buy deflazacort without a prescription - <a href="https://lazacort.com/brimonidine/">brimonidine online</a> brimonidine online
Dyvnmr
besivance for sale online - <a href="https://besifxcist.com/sildamax/">generic sildamax</a> cheap sildamax generic
Zbztsr
order gabapentin 100mg generic - <a href="https://aneutrin.com/ibuprofen/">generic ibuprofen 600mg</a> purchase sulfasalazine without prescription
Qaflvr
probenecid 500 mg oral - <a href="https://bendoltol.com/carbamazepine/">purchase carbamazepine online</a> carbamazepine 400mg drug
Ayggaj
mebeverine 135mg cheap - <a href="https://coloxia.com/etoricoxib/">buy etoricoxib 60mg without prescription</a> pletal 100 mg cost
Qosncv
cheap celebrex 100mg - <a href="https://celespas.com/">celebrex over the counter</a> order indomethacin 75mg capsule
Kaqeqi
order voltaren 100mg - <a href="https://dicloltarin.com/">cambia brand</a> order generic aspirin
Pjigsv
brand rumalaya - <a href="https://rumaxtol.com/amitriptyline/">buy generic amitriptyline for sale</a> buy generic amitriptyline for sale
Qotmev
pyridostigmine 60 mg canada - <a href="https://mestonsx.com/azathioprine/">order imuran online</a> buy imuran 25mg pills
Bnhsna
buy generic voveran - <a href="https://vovetosa.com/animodipine/">buy cheap generic nimodipine</a> order nimotop sale
Ywjsfo
ozobax canada - <a href="https://baclion.com/">buy lioresal</a> how to get piroxicam without a prescription
Sjzfle
where can i buy meloxicam - <a href="https://meloxiptan.com/asrizatriptan/">buy maxalt pills</a> order toradol without prescription
Nsbvnl
buy cheap generic periactin - <a href="https://periheptadn.com/aszanaflex/">order tizanidine for sale</a> generic tizanidine 2mg
Disjcg
how to buy artane - <a href="https://voltapll.com.com/">brand artane</a> voltaren gel buy online
Tpdvjb
purchase cefdinir generic - <a href="https://omnixcin.com/clindamycin/">buy cleocin generic</a> purchase cleocin gel
Aojibe
buy accutane - <a href="https://aisotane.com/asdeltasone/">buy deltasone 20mg for sale</a> order generic deltasone 20mg
Ifggbu
order prednisone 40mg without prescription - <a href="https://apreplson.com/prednisolone/">buy prednisolone 10mg pills</a> oral permethrin
Pviauk
acticin us - <a href="https://actizacs.com/asbenzac/">buy benzoyl peroxide for sale</a> retin gel tablet
Bklykp
flagyl pills - <a href="https://cenforcevs.com/">buy generic cenforce over the counter</a> buy cenforce online cheap
Scefcl
betamethasone creams - <a href="https://betnoson.com/">betnovate 20 gm creams</a> benoquin for sale online
Gnaseb
buy clavulanate pills - <a href="https://baugipro.com/">augmentin 1000mg pills</a> cost levoxyl
Mymnls
cleocin oral - <a href="https://clinycinpl.com/">clindamycin tablet</a> buy generic indocin 50mg
Aeuovq
cozaar 25mg for sale - <a href="https://acephacrsa.com/">order keflex 250mg for sale</a> cephalexin 250mg cheap
Wybnsy
crotamiton us - <a href="https://aeuracream.com/abactroban/">brand bactroban ointment</a> purchase aczone for sale
Hsdgyv
purchase bupropion pills - <a href="https://bupropsl.com/orlistat/">order orlistat pills</a> purchase shuddha guggulu
Ddxpbr
prometrium cost - <a href="https://apromid.com/">buy progesterone pill</a> where can i buy fertomid
Pzmnvl
order xeloda online - <a href="https://xelocap.com/naproxen/">buy naproxen 250mg online</a> buy generic danocrine online
Dagqvc
norethindrone 5mg for sale - <a href="https://norethgep.com/lumigan/">lumigan over the counter</a> purchase yasmin without prescription
Lonuzw
purchase fosamax generic - <a href="https://pilaxmax.com/pilex/">buy pilex tablets</a> purchase provera pill
Tswvdr
order cabergoline 0.5mg online cheap - <a href="https://adostilin.com/alesse/">oral alesse</a> alesse generic
Apixlk
buy estradiol online - <a href="https://festrolp.com/ginette-35/">buy ginette 35 for sale</a> how to get arimidex without a prescription
Onitdk
シルデナフィル の購入 - <a href="https://jpedpharm.com/">ばいあぐら</a> シアリス 海外通販
Ytoily
プレドニン 飲み方 - <a href="https://jpaonlinep.com/jamoxicillin/">アモキシシリン の購入</a> アジスロマイシン は通販での購
Wlxmfd
eriacta parlour - <a href="https://eriagra.com/szenegrag/">zenegra pills pad</a> forzest mistress