Sanya WordPress akan Ubuntu a matakai uku masu sauƙi tare da Docker

rubutun kalmomi

Ofaya daga cikin abubuwan da yakamata muyi bayan girka Ubuntu 16.04, kuma ƙari idan mun fito daga tsaftacewa, shine sake sanyawa duk waɗannan shirye-shiryen da muke amfani dasu a cikin Ubuntu. Idan kun kasance maginin yanar gizo tabbas kuna da sha'awar girkawa WordPress akan PC din ku. Saboda haka, a Ubunlog muna son nuna muku yadda shigar da WordPress cikin Ubuntu cikin sauƙin bin matakai uku kawai, ta hanyar kayan aikin da ake kira Docker. Muna gaya muku.

Menene Docker?

Da farko dai kuma da farko dai, yana da kyau a bayyana menene shi da yadda yake aiki Docker. Da kyau, Docker aikace-aikacen kyauta ne wanda ke ba mu damar shirya ayyukanmu na software a cikin abin da muka sani a matsayin akwati (akwati a Turanci). Ta wannan hanyar, zamu iya samun Kammala tsarin fayil wanda ya ƙunshi duk abin da kuke buƙata (lambar tushe, ɗakunan karatu masu mahimmanci, kayan aikin tsarin ...) don iya gudanar da aikace-aikacen da aka faɗi akan kowane injin da ke tallafawa Docker, kamar dai šaukuwa app.

Shigar da Docker da WordPress

Docker yana da kayan aikin da ake kira Docker Shirya hakan yana taimaka mana daidai don sarrafa kwantena na aikin, don haka muna iya farawa, dakatarwa, share su ko ganin matsayin su. Don shigar da shi kawai dole ne mu aiwatar da umarni mai zuwa a cikin tashar:

sudo dace-samun shigar docker-shirya

Amfani da Docker don shigar da WordPress

Yanzu tunda mun san menene Docker kuma mun girka shi, zamu iya ci gaba da amfani dashi don girka WordPress.

  • Mataki na farko shine ƙirƙiri shugabanci kira, misali, wordpress (Na sani, asali ne na asali) a cikin kundin adireshi ta amfani da wannan umarnin:

mkdir ~ / kalma

  • Na gaba, a cikin wannan kundin adireshin, dole mu yi ƙirƙiri fayil da ake kira docker-compose.yml, wanda zamu iya yi ta hanyar zuwa kundin adireshi sannan ƙirƙirar fayil ɗin da ake so, ma'ana: aiwatarwa:

cd

taɓa docker-compose.yml

  • Fayil docker-compose.yml dole ne ya sami waɗannan abubuwan masu zuwa:

kalma:
hoto: kalma
alaƙa:
- wordpress_db: MySQL
mashigai:
- 8080:80
kundin:
- ~ / wordpress / wp_html: / var / www / html
wordpress_db:
hoto: mariadb
muhalli:
MYSQL_ROOT_PASSWORD: misali wucewa
minda:
hoto: corbinu / docker-phpmyadmin
alaƙa:
- wordpress_db: MySQL
mashigai:
- 8181:80
muhalli:
MYSQL_USERNAME: tushe
MYSQL_ROOT_PASSWORD: misali wucewa

SAURARA: Zaka iya kwafin-kwafe abun cikin fayil din da hannu ko kuma, akasin haka, kwafa shi ta hanyar aiwatarwa:

amsa kuwwa file_contents> docker-shirya.yml

  • Mataki na karshe shine fara Docker, wanda zamu iya yin sa ta gudu:

sudo docker-shirya farawa

Yanzu kawai zaku bude burauzarku (Firefox, Chromium ko Chrome) ku je localhost: 8080 ta akwatin rubutu na sama. Kuma shi ke nan! Da sauki?

A matsayin taƙaitaccen bayani, muna son tunatar da ku abin da muka aikata. Da farko dai, muna da shigar docker, kayan aiki wanda ke taimaka mana mu tattara kayan aikin Software a cikin kwantena don sauƙaƙe zuwa kowane tsarin. A ƙasa muna da halitta fayil docker-compose.yml tare da Ana buƙatar daidaitawar WordPress, don ƙarshe fara Docker. Muna fatan cewa wannan sakon ya taimaka muku girka WordPress akan Ubuntu kuma idan kuna da wasu tambayoyi, to ku bar su a cikin ɓangaren maganganun. Har sai lokaci na gaba 😉


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

2 comments, bar naka

Bar tsokaci

Your email address ba za a buga.

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

  1.   Pepe m

    Ban fahimci abu daya ba. Fayil na docker-compose.yml shine fayil ɗin daidaitawa, amma ta yaya aka shigar da wordpress?

  2.   Javivi "the Vivi" San m

    Na ci gaba mataki-mataki kuma ba ya aiki, Ina da wannan kuskuren lokacin da na yi umarni na ƙarshe

    sudo docker-shirya farawa

    Kuskure: yaml.scanner.ScannerError: yayin binciken mabuɗin mai sauƙi
    a cikin "./docker-compose.yml", layi na 4, shafi na 1
    ba a sami tsammani ba ':'
    a cikin "./docker-compose.yml", layi na 5, shafi na 1