From a039510d7f9f8fe68b0ad4f199240961ae46cb81 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 11 Sep 2019 09:00:12 +0200 Subject: [PATCH] Server configuration --- Makefile | 1 - .../group_vars/webservers/vault.yaml | 75 +++++++++++-------- ansible/roles/web/templates/docker-compose.j2 | 50 ++++++------- 3 files changed, 69 insertions(+), 57 deletions(-) diff --git a/Makefile b/Makefile index c848c6d..bc3edc0 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,6 @@ logs: docker-compose logs -f --tail=500 backup: - docker-compose start postgres docker-compose exec web ./manage.py dumpdata --natural-foreign -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailimages.rendition -e sessions -e feedler.feedlysettings > ~/publichealth.home.json zip ~/publichealth.home.json.`date +"%d%m%Y-%H%M"`.zip ~/publichealth.home.json rm ~/publichealth.home.json diff --git a/ansible/inventories/production/group_vars/webservers/vault.yaml b/ansible/inventories/production/group_vars/webservers/vault.yaml index aa7ab1e..d720ba8 100644 --- a/ansible/inventories/production/group_vars/webservers/vault.yaml +++ b/ansible/inventories/production/group_vars/webservers/vault.yaml @@ -1,32 +1,45 @@ $ANSIBLE_VAULT;1.1;AES256 -39613133383630663164333437633037383936663266623861313565663964346232643666653332 -6165666665373661643663323337656163373631366135620a663164653335333166333865383139 -34633364623536663564363536333737316638353266316261393530386330633963336233346336 -6336383237646233630a656337626566373165313264386438636230646438353131623663666236 -62633739623431656535383166343862646133396630306264636563643536373562363163316135 -38373966323162653330316135333333643637323732663530336432383066316636303231653534 -37333765313830646662663761376266386262323437373230333231616162393961396162383732 -62633431343062316365316361343432373261623439656533393331383735646639646662653133 -36303039383339353961336664343436653066626561393761383733656664663939333233396134 -63393361396334666330376362643732326266336263393730623464333436336436313639613635 -64646237333739373137356262373666356631356632323466383363356366366366666330646230 -63386232663430386139393864626333326331323031313231346630326133353137373565326538 -36633032653637316531353131653235613331333436316365316661313835373563646534353239 -38623338373365623066613832623836626135326235623538396538366663306365666135633264 -34306464663230616538343539653663326339333437303762323066343933326634633530653565 -34663963353562363132396338623435646165393431303364623834636266373164663933633339 -32346536363330303539373461376631613863656366646437343165633464623064396231346137 -30643261346465303137306161613036336339326530306162393165363766353839316262363263 -38303236633436323830356461653234666534646363336463313064386230663763323632313563 -35396233363933333463326333633737333962353830336135386339613564343237363932306362 -31333535376630363739653433663865366566356132633032666562653234373938633031323139 -61306539376464666664316461303966613231646136623937643965326139303461616366333631 -39323638633661623064623334333864633235646131353237663361343839303537306261656131 -66656331316264636261643165643861376330633035386165626166313133376538656166353136 -31303433633134323532646132386130616431383065363832326533653535663763623733353764 -63383061653062353263383739643366363763363635663165353761623832366139643065396565 -31363435613761623538383237346431613335346437616538643462316665656337343832633937 -33663266663163306461626462626132613961626238333538666233613934346631346231363833 -36633138656563643262393764663331333237386164626230383562396663336564663134356632 -39386137343662666166326131363633353536326130396361376138363132363861313832303262 -326364356331366330393435346330373561 +30626232643339383163393232623961623366323463316261386261306433396537353264656535 +3762363861393739636564646263396137323534346666640a646433303864656633356266613966 +30356634336230656138396437653034643239643966343866316334343536646264343437346539 +3734343734313934330a333663333635353230646431343566636432306364336565643864346162 +34393531616636323035666438366461323437316538626539366539333837633363636139353261 +30613332396333613938346563323131323463653331356135383466626362373734336464633033 +37326465363236663834323936386237346364393437353138393836653262656162343964633633 +66333165346562376531663637656135366135663562656436386330636436303164363430336631 +30663935386363326337646461636362383936316461336562356232383034633764623264373161 +63343662643834333464376161666532663639663835633031333562653064333039376132323139 +36373336373161346332343531626130313039303066323364613139636334356131346662353532 +34323032656132363734653466643566646463323163393330396265373638663564643337303431 +37363039306539613839643061326633363764616237353538663432626631336365343463653737 +36316166346337646430373865353433346633646533313762626530646237353730653365663035 +63383366303266626430646639396636343239656636653061383637306437303533383062313135 +34323066633535613562393961303134306131306430343836613565343934323761353066386561 +61646231383433396430323335343530396333346431356134393339306262393933653934663435 +66383730373633326330373239313235643634313737313935666538353432363233366538626634 +66346535313762646132316561393234666565633839306264323565333738663763376563653264 +36666631663335343837376530633337363636663639623937343930313932323765363463626631 +35646436363232323661613761646231353862383736336262616364303861636465366364633762 +37373966363166633739646165333738346534353633313039356336626161323236346436393064 +37323132613836336237373364333032373435666334623436386335613038303632333435336236 +34313039633831326562623135646265383737323361353764616230636464343363306431376531 +38646635353835633032393863333836633963366361383238616239376437303136626238373736 +30333966396431393161386665373432333934646136313735616436353363616532613963353535 +31653338383538323439666264393539646663646435353838636231343336636666323165663736 +39316632353632363232326463666566316437396262316430336538346633663432343330383465 +63393463333034383966343238373964653631643465353163323531356231623130303831643431 +64623037396337613536666361336231333262396434346130633134333434626433633861306364 +37646233643832356162386438373638363831663331656638363165663262383662363965376464 +33323666613564343136643734656131646130623061323966326665373239383966383665373931 +64306361336534363863303463306163376661323633333030656432313536376462633663343162 +34303938633233386164336161366266633334643665626461353134633662326134383061653231 +35646430346239326233666432343034373936316433326164633035356337613864376235646235 +33616631393432366437343630666566316664386261393463646666653264353862633537303038 +61346434376561376233343863383239326564363263313438666235653436303062353334316634 +63653262373533633066336338326235393439643264383163336139316166613462623131396138 +31303937393432613732306235393738633732643464646131653230653736613539653034643561 +33396436366235306138373662636238356331663833303462623263306538386461613038363565 +65303130343761376461356239326333616139643133626637323033333466666163666136313233 +30636430313662383635346561643433343137303631646134313563663330643635643633333334 +33653261613361383534356563333962366136383734623366616662326661333539613163343738 +61356234373935316665 diff --git a/ansible/roles/web/templates/docker-compose.j2 b/ansible/roles/web/templates/docker-compose.j2 index 20600bf..5057364 100644 --- a/ansible/roles/web/templates/docker-compose.j2 +++ b/ansible/roles/web/templates/docker-compose.j2 @@ -5,10 +5,10 @@ web: volumes: - ./:/usr/src/app - {{ django_log_dir }}:/var/log/wagtail - links: - - redis - - postgres - - elasticsearch + #links: + # - redis + # - postgres + # - elasticsearch ports: - "5000:5000" environment: @@ -19,25 +19,25 @@ web: - MAILGUN_DOMAIN={{ django_email_domain }} - MAILGUN_FROM={{ django_email_from }} - DATABASE_URL={{ django_postgres_url }} - - ELASTICSEARCH_URL=http://elasticsearch:9200 - - REDIS_URL=redis://redis:6379 + - REDIS_URL={{ django_redis_url }} + - ELASTICSEARCH_URL={{ django_elasticsearch_url }} - LOG_DIR=/var/log/wagtail -redis: - image: redis - command: ["redis-server", "--appendonly", "yes"] - restart: on-failure - volumes: - - {{ redis_data_dir }}:/data - ports: - - "6379:6379" -postgres: - image: postgres - ports: - - "5432:5432" -elasticsearch: - image: elasticsearch:5 - ports: - - "9200:9200" - environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - mem_limit: 1g +# elasticsearch: +# image: elasticsearch:5 +# ports: +# - "9200:9200" +# environment: +# - "ES_JAVA_OPTS=-Xms512m -Xmx512m" +# mem_limit: 1g +# redis: +# image: redis +# command: ["redis-server", "--appendonly", "yes"] +# restart: on-failure +# volumes: +# - {{ redis_data_dir }}:/data +# ports: +# - "6379:6379" +# postgres: +# image: postgres +# ports: +# - "5432:5432"