Compare commits

...

2 Commits

Author SHA1 Message Date
Quentin Duchemin 5da61f24dc
Add CouchDB instance 2022-03-03 12:13:31 +01:00
Quentin Duchemin e2a562f04f
Remove Lola's blog files 2022-03-03 12:01:35 +01:00
10 changed files with 126 additions and 235 deletions

View File

@ -18,10 +18,6 @@
tags:
- docker
- traefik
- role: grav
tags:
- docker
- grav
- role: lychee
tags:
- docker
@ -51,3 +47,7 @@
tags:
- docker
- peertube
- role: couchdb
tags:
- docker
- couchdb

View File

@ -1,62 +1,65 @@
$ANSIBLE_VAULT;1.1;AES256
66626162663730373635326163373965343861663739393339363966626662316362393866653364
6633323964643438353835613430323032303439636530350a333633363339333161356266303433
38663635366438303937303761633431323133326464643833616633353566643465393236653030
3830346637303931350a326665353834303737333165643239653932666162666564336534333237
36626563663731323239343735613635363466646563653039643862373938636665386537333338
66346164356364353134323362383965323763346332666632386332643231653138633736623464
31303338306131633666643663396431373239636139376539336264366561313434336431353739
65303363316561366436313934316236396237626136663462343939316565366638343432373666
33616539643635633737393535343734366331383935626564366564366162303939326235653937
30336362333661306631306564323535326135616638333862616565336336396530343861313263
38356334333737626331396336316139653063383735353161396361366564393265653334383137
65323461646464383463643831366566323566333638323134393934313861643039626132323265
39313838626163653634656436633239653566633631383438303936653064363531346638313139
34643862386661346166333066633831306530366536353461646636323333363664313466313264
33353066386566306137616234666161623537323439323164666534313662323464376265623635
36613331656537343766396463316237373562336562613234626138326636316134613532313033
63373035653831313937386430653230336430346231366239623532613632343563386438646638
66323561353361663162636233323637333138396364306230656431643166376537356633376230
38663638656233383464626435616365363436643365666632346538616536653039373664643764
62393533623034613139633164343938323262313665616661326162383731626463656339613534
38346137646434333261356438313932623263663363646432386561643933373365323861646138
65633132326666373465326361653934653438653533346535303662373264386466663830303538
64303061653537636262633533383163396531636336333137363235303939363662643965356436
32323063353236623334343331356336616565393731333839326362333830623834326639383934
39343164386466333331623062653564646138666235386438393362366137353266636162376433
63666235303334343337343034396230653136366134373036613135313561633936343266653333
31363634393462613139313466383537393661336163313134313263373234313131316436656536
35643165383361616462343734663336366264323732646234323963373938303030336364633930
64356561363165326335616363663662363335656235366430323039313134303139646662303965
31373738623761613938613937316636633462336631303334376632333937616561373533346332
33313735653463623665616333383931663536646532333531613636373062663064326134646637
32653032306531343434303630393834626130313733356666633765643032353138353739383163
38396261636137366366316464353937363532336465353238313961356634636664633263383534
30636366383938613230643431626662366238343831366261336530636564633737313736373831
66666236653762343632313838386633306239663361316430393832653933363833313331643230
38353631396133326362366562623435623466633537646665313539343639626563613330333131
34613565663566323934343364346666346561626439653565633437393333363933303934313761
33383464336564646338646335386532356361656536323435373133653061363265633865643733
32356665623863303432303937373932333666313232653432633764646537333432373935623338
62356436616265303131636164353631623439363836613331373537646432373965343864656233
63366462653962373932333165373731663236633962336432333633643136343135643239313931
61323566313861353061353862316139663130313334643965313763613832396134623161383064
36633831343963613433323337346438346133333431666531366631323036343038366437326538
64323736376361306338346536666464343166373436666430323062363030316138613762643739
35363834653236303336613161393032656662373361333531366237656566303435633536383435
65393832313966353838323663323637386338333239383238643766313330643234353936656365
33363561393463353333363033353132643961366462626635333134656339663637353661333164
32366531303733336564313464636137346166323537656433626534383062373036306132643831
39643933636432373065326666633832663832633830343566356262613031393062623065326561
66396333623032653661353239346664316235366331363732363837306530666438623630376531
34626535393930633835656438643235616338383363303234666461346165333138383962623336
32386133653232353562326331643462353962376636303533366339383965316566666136376336
39353933363161643139323061363162333063633764633761313734666532626434636531386262
34613633666431666134396536646138346636376362373662666537386430343737343939303663
66393932613632383038323239636539656534316434356237626437343165386339393764633462
65303862336237313535623337643664633565343234633566353561343837313138353164646434
65373832396239353363333637343331373663633839316665306139626338326539326137303634
38623162663530383564653362356462396433383066383861666366383739373933303038396437
30336561363337356263326363343035656264643566316262656538636335333965623836646336
34636465646430366364333436383462353137653062373331353538636438313934636233646533
6363
39633762353432626632623631396538633465616537616165613931393635386130623262663330
6164396134316431616330626330363733643635613534380a353936623230393466353636333566
34333762613465313337346162386336653465636564326135303430346234306262306465626335
3966373833383166380a323730393135626639363533646537383633643063623566376337633962
37383230623163613238356431316432343730383332363465623464636332303439393039373737
64666536653136623066353563353234666532343434633730366531613333663235633134613439
30383338313364353238656239363039636261643231393833653765663732386437653838356136
37613533313661303865663539313230326236393936646266336334343835313431373362333831
36343538313935363964336161396163376331336237616336656332303938346536313966306535
39313637336465616631376364393839646239353663313733613763376662323136653835333566
35643265316133323063386334343666666531303030383139313362393937363135333232313536
61653731616432343537653863363438666364316539663761313732373863663734623239643839
30643765333630366364366535633837626136336138663932366136303239383162643162376666
33363435623739613366343762313330363162633135316664393636336632343266396438653639
32376230633039643566633435353236633438613836633030633733306138366536613036376537
65643735653139613666376362626430666461386465623330373166623964373633313762393139
63326463343138326433623064623362646264353666383365646334373131313031336330313936
34313365626139646637346562646632353733386532316634356136313530623538643437313564
61356236333730386239616235626536656666623062663638613761646632363538356238306135
34333839333438643039623633313033393630333933383539653732316637623631656133303433
65326536343365316430303538353437306265363765363131653034383130333235333232346336
35396231323339303632333637633061636263646132326562383335306533363933373130613437
32656132356135386632316463323331366266396139313735633636653431666530313231316366
31333365353935353339346534353065383532666463633861663265336438643436356262313738
34366239656465613530396130323531393038393466326632336539316536376637653665396466
32353639396438326135646439376638623766306530376434353332646661666364316663333562
66623738366366633363343763653530663836386561353435643435323164646465313434633963
38656530333766356538656366663565633535666137646438353636356632386536363765613835
30396434333939323262326135633236366439643239303361303837303630643733333131366235
63333963343563333132663938616131333332643339346563393933343034633031396436396461
63636131343134613333663661643335363461393363356336373132343930383665323564343162
66656538333831316663316435316561323433633464383464623531346531646366303938373166
61613836383831393965613731316536306636363264346637323938653130353265373764626130
39303033663864353362623034643862376634633265623234303666643366386537636465643739
35613236633733666533363066636331323038346333356139303461353131376361613664653166
37303038333633363061393864333431663638626261653661643333373634613937313962653365
37343335653363353635383038646331626137353162383961626538393764333039666239643131
65663439333137373736343137616163316137656134616664383562396533646465616665653339
61336538343531383363383231623139333132646438633262383565636135396539363932653837
39343061363032386236326665303933313236323261326662316561626162323739623030393664
65316561366331656462383933653838623462363632656433386162316464363836343464326431
61383865376332343331616337373032343038383832653562623131303664393730623634366364
62636432626439373436356437383337323436613334643739363466303063613630306338326364
65373466326433363035646662663337626634373963303763316336366165313636386639333930
63396330616162656264336639663130653165323463343531383534376233313934663538356165
37393266323061333363356137663165353033623162313238613932303461363465346235353531
63363536663631636533373231373935316561306162376138326635653362363561343961306538
30303364333637643565613263323365343265663331376431616333353037313635633530616162
36353634343834303465636466353337613964393636316334353839386266653339356432383066
64353163633263613834616631653936613434373635363231396361363436656135306531353964
66613362323133626234636235323564393533346133613231333266323664663533303939666165
62386663663937313763343936623861623937343332393731656365656566333761373961346333
61303866616635396664613666353165326664383636316661656635313231643166303065353930
31656635316133363937646661386530663166363031663166663066623337353936656239303535
35303535386131313162623931393435643331663934623234303665393038613139383539613238
36326165376130643663653163313533323864306166646339373061373461646239313265336336
33653035303534313363393763323965336134373530313537343433313831633232356664646166
31636235383262626335393362386466306666343064333261663138313635373237343965643763
64353032306330623930376561303338313863313063626661373333366531656634633531316538
38633834636436383939666132633164383631626665306636613764623631353534633235363865
38613162396133653730336235383964646237303330616237623738343731363935326633656430
35633231396137316339343035343731616238616431323162623866326138656632363331393032
33373932633132653261616132626638613532313532636561616131383538306435303731646531
38356338633761383339

View File

@ -0,0 +1,24 @@
---
- name: Create CouchDB directory
file:
path: "{{ couchdb_folder_name }}"
state: directory
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0755
- name: Copy CouchDB Compose file
template:
src: docker-compose.yml.j2
dest: "{{ couchdb_folder_name }}/docker-compose.yml"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
- name: Ensure container is up to date
community.docker.docker_compose:
project_src: "{{ couchdb_folder_name }}"
remove_orphans: yes
pull: yes
recreate: smart
state: present

View File

@ -0,0 +1,29 @@
version: "{{ compose_version }}"
networks:
proxy:
name: "{{ traefik_network }}"
volumes:
db:
name: couchdb
services:
couchdb:
image: "couchdb:{{ couchdb_version }}"
container_name: couchdb
networks:
- proxy
volumes:
- db:/opt/couchdb/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
COUCHDB_USER: "{{ couchdb_user }}"
COUCHDB_PASSWORD: "{{ couchdb_password }}"
labels:
traefik.http.routers.couchdb.entrypoints: websecure
traefik.http.routers.couchdb.rule: "Host(`{{ couchdb_subdomain }}.{{ domain_name }}`)"
traefik.http.services.couchdb.loadbalancer.server.port: 5984
traefik.enable: true
restart: unless-stopped

View File

@ -0,0 +1,5 @@
couchdb_version: "3.2.1"
couchdb_folder_name: "{{ docker_files }}/couchdb"
couchdb_subdomain: couchdb
couchdb_user: "couchdb"
couchdb_password: "{{ couchdb_db_password }}"

View File

@ -1,7 +0,0 @@
#!/bin/sh
set -e
echo "Launching supercronic..."
supercronic /var/www/crontab &
echo "Launching Grav..."
exec $@

View File

@ -1,41 +0,0 @@
---
- name: Create Grav directory
file:
path: "{{ grav_folder_name }}"
state: directory
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0755
- name: Copy Grav templates
template:
src: "{{ item }}"
# Remove .j2 extension
dest: "{{ grav_folder_name }}/{{ (item | splitext)[0] }}"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
loop:
- docker-compose.yml.j2
- Dockerfile.j2
- name: Copy Grav entrypoint
copy:
src: entrypoint.sh
dest: "{{ grav_folder_name }}/entrypoint.sh"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
- name: Build Grav
community.docker.docker_compose:
project_src: "{{ grav_folder_name }}"
build: yes
- name: Ensure container is up to date
community.docker.docker_compose:
project_src: "{{ traefik_folder_name }}"
remove_orphans: yes
pull: yes
recreate: smart
state: present

View File

@ -1,92 +0,0 @@
FROM php:7.4-apache
LABEL maintainer="Andy Miller <rhuk@getgrav.org> (@rhukster)"
# Enable Apache Rewrite + Expires Module
RUN a2enmod rewrite expires && \
sed -i 's/ServerTokens OS/ServerTokens ProductOnly/g' \
/etc/apache2/conf-available/security.conf
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libyaml-dev \
libzip4 \
libzip-dev \
zlib1g-dev \
libicu-dev \
g++ \
git \
cron \
vim \
&& docker-php-ext-install opcache \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'upload_max_filesize=128M'; \
echo 'post_max_size=128M'; \
echo 'expose_php=off'; \
} > /usr/local/etc/php/conf.d/php-recommended.ini
RUN pecl install apcu \
&& pecl install yaml-2.0.4 \
&& docker-php-ext-enable apcu yaml
# Install Supercronic
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=048b95b48b708983effb2e5c935a1ef8483d9e3e
RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
# Create cron job for Grav maintenance scripts
RUN echo "*/30 * * * * cd /var/www/html;/usr/local/bin/php bin/grav scheduler 1>> /dev/null 2>&1" > /var/www/crontab
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN sed -i s/80/{{ grav_internal_port }}/g /etc/apache2/sites-enabled/000-default.conf /etc/apache2/ports.conf
# Set user to www-data
RUN chown www-data:www-data /var/www
USER www-data
# Set Grav version
ARG GRAV_VERSION={{ grav_version }}
# Install grav
WORKDIR /var/www
RUN curl -o grav-admin.zip -SL https://getgrav.org/download/core/grav-admin/${GRAV_VERSION} && \
unzip grav-admin.zip && \
mv -T /var/www/grav-admin /var/www/html && \
rm grav-admin.zip
# Install plugins
RUN cd html && \
bin/gpm install admin
# provide container inside image for data persistance
VOLUME ["/var/www/html"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]

View File

@ -1,27 +0,0 @@
version: "{{ compose_version }}"
networks:
proxy:
name: "{{ traefik_network }}"
volumes:
grav_lola:
name: grav_lola
services:
grav_lola:
image: grav:{{ grav_version }}
build: .
container_name: grav_lola
volumes:
- grav_lola:/var/www/html
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- proxy
labels:
traefik.http.routers.grav.entrypoints: websecure
traefik.http.routers.grav.rule: "Host(`blog.leaula.me`)"
traefik.http.services.grav.loadbalancer.server.port: "{{ grav_internal_port }}"
traefik.enable: true
restart: unless-stopped

View File

@ -1,3 +0,0 @@
grav_internal_port: 8080
grav_version: 1.7.13
grav_folder_name: "{{ docker_files }}/grav"