Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fead7f0ce2 | ||
|
|
cd67194649 |
No files matched your search
@@ -1,20 +0,0 @@
|
||||
name: spellcheck
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
check_filenames: true
|
||||
|
||||
typos:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: crate-ci/typos@master
|
||||
@@ -1,2 +1,2 @@
|
||||
plausible-conf.env
|
||||
data/
|
||||
.env
|
||||
@@ -1 +0,0 @@
|
||||
*
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Plausible Analytics
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,16 +1,9 @@
|
||||
<clickhouse>
|
||||
<yandex>
|
||||
<logger>
|
||||
<level>warning</level>
|
||||
<console>true</console>
|
||||
</logger>
|
||||
|
||||
<!--
|
||||
Avoid the warning: "Listen [::]:9009 failed: Address family for hostname not supported".
|
||||
If Docker has IPv6 disabled, bind ClickHouse to IPv4 to prevent this issue.
|
||||
Add this to the configuration to ensure it listens on all IPv4 interfaces:
|
||||
<listen_host>0.0.0.0</listen_host>
|
||||
-->
|
||||
|
||||
<!-- Stop all the unnecessary logging -->
|
||||
<query_thread_log remove="remove"/>
|
||||
<query_log remove="remove"/>
|
||||
@@ -18,6 +11,4 @@
|
||||
<trace_log remove="remove"/>
|
||||
<metric_log remove="remove"/>
|
||||
<asynchronous_metric_log remove="remove"/>
|
||||
<session_log remove="remove"/>
|
||||
<part_log remove="remove"/>
|
||||
</clickhouse>
|
||||
</yandex>
|
||||
@@ -1,8 +1,8 @@
|
||||
<clickhouse>
|
||||
<yandex>
|
||||
<profiles>
|
||||
<default>
|
||||
<log_queries>0</log_queries>
|
||||
<log_query_threads>0</log_query_threads>
|
||||
</default>
|
||||
</profiles>
|
||||
</clickhouse>
|
||||
</yandex>
|
||||
@@ -1,9 +1,7 @@
|
||||
version: "3.3"
|
||||
services:
|
||||
plausible_db:
|
||||
# Plausible v2.1.1 was tested against PostgreSQL versions 15 and 16
|
||||
# https://github.com/plausible/analytics/blob/v2.1.1/.github/workflows/elixir.yml#L21-L32
|
||||
image: postgres:16-alpine
|
||||
stop_grace_period: 60s
|
||||
image: postgres:12
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
@@ -11,12 +9,10 @@ services:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
|
||||
plausible_events_db:
|
||||
image: clickhouse/clickhouse-server:24.3.3.102-alpine
|
||||
stop_grace_period: 60s
|
||||
image: yandex/clickhouse-server:21.3.2.5
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data/clickhouse:/var/lib/clickhouse
|
||||
- ./data/clickhouse-logs:/var/log/clickhouse-server
|
||||
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
|
||||
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
|
||||
ulimits:
|
||||
@@ -25,14 +21,13 @@ services:
|
||||
hard: 262144
|
||||
|
||||
plausible:
|
||||
image: ghcr.io/plausible/community-edition:v2.1.1
|
||||
stop_grace_period: 60s
|
||||
image: plausible/analytics:latest
|
||||
restart: always
|
||||
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
|
||||
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
|
||||
depends_on:
|
||||
- plausible_db
|
||||
- plausible_events_db
|
||||
ports:
|
||||
- 127.0.0.1:84:8000
|
||||
env_file:
|
||||
- .env
|
||||
- plausible-conf.env
|
||||
@@ -0,0 +1,24 @@
|
||||
version: "3.3"
|
||||
services:
|
||||
plausible:
|
||||
depends_on:
|
||||
- geoip
|
||||
environment:
|
||||
- GEOLITE2_COUNTRY_DB=/geoip/GeoLite2-Country.mmdb
|
||||
volumes:
|
||||
- geoip:/geoip:ro
|
||||
|
||||
geoip:
|
||||
image: maxmindinc/geoipupdate
|
||||
restart: always
|
||||
environment:
|
||||
- GEOIPUPDATE_EDITION_IDS=GeoLite2-Country
|
||||
- GEOIPUPDATE_FREQUENCY=168 # update every 7 days
|
||||
env_file:
|
||||
geoip/geoip.conf
|
||||
volumes:
|
||||
- geoip:/usr/share/GeoIP
|
||||
|
||||
volumes:
|
||||
geoip:
|
||||
driver: local
|
||||
@@ -0,0 +1,2 @@
|
||||
GEOIPUPDATE_ACCOUNT_ID=<your-account-id>
|
||||
GEOIPUPDATE_LICENSE_KEY=<your-license-key>
|
||||
|
Before Width: | Height: | Size: 491 KiB |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 191 KiB |
|
Before Width: | Height: | Size: 265 KiB |
|
Before Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 200 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 207 KiB |
|
Before Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 226 KiB |
|
Before Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 239 KiB |
|
Before Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 223 KiB |
|
Before Width: | Height: | Size: 237 KiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 245.4992501 66.0242793"><defs><style>.cls-1{fill:url(#New_Gradient_Swatch_1);}.cls-1,.cls-2,.cls-3,.cls-4{stroke-width:0px;}.cls-2{fill:url(#New_Gradient_Swatch_1-2);}.cls-3{fill:#5850eb;}.cls-4{fill:#fff;}</style><linearGradient id="New_Gradient_Swatch_1" x1="14.8413403" y1="22.5436904" x2="27.4731407" y2="44.6493411" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#909cf7"/><stop offset="1" stop-color="#4b38d8"/></linearGradient><linearGradient id="New_Gradient_Swatch_1-2" x1="7.9837957" y1="-1.3582919" x2="21.0009873" y2="21.4217935" xlink:href="#New_Gradient_Swatch_1"/></defs><g id="Plausible_-_Branding"><g id="CE_Gradient_Logo_-_Color_Gradient_on_Black"><g id="Symbol_-_Purple_Gradient"><path class="cls-1" d="M45.2456059,22.6027536c-1.0911024,10.4557623-10.2327486,18.2272825-20.7452872,18.2272807h-4.047804v9.570007c0,5.3019285-4.2980623,9.5999908-9.5999908,9.5999908H3.3599854c-1.8556687,0-3.3599854-1.5043167-3.3599854-3.3599854v-19.7025146l5.0380685-7.0686343c.9118097-1.2793096,2.587965-1.7566996,4.0369945-1.1497867l2.8657142,1.2002785c1.4444817.6050081,3.1153774.12945,4.0247968-1.1455083l6.7172007-9.417163c.9071158-1.2717288,2.5743943-1.7450816,4.0144283-1.1397262l5.5198678,2.3204187c1.4430268.6066135,3.1137697.1319561,4.0223175-1.1427389l6.4594145-9.0625757c2.0248091,3.5597961,3.0145069,7.7887694,2.5468032,12.2706573Z"/><path class="cls-2" d="M3.2920959,28.8726296c.82329-1.1551271,2.0209115-2.0434967,3.4138697-2.3114381,1.0861554-.2089265,2.156905-.0992829,3.1472499.3155174l2.8649902,1.1999512c.1651001.0691528.3388672.104187.5164795.104187.4365845,0,.8488159-.2124634,1.1026611-.5683594l6.5942097-9.2447929c.8231505-1.154021,2.0204067-2.0410099,3.4124878-2.3083136,1.0821376-.2077892,2.1463585-.0989034,3.1282512.3138487l5.5198364,2.3204346c.1665649.0700684.3417969.1055298.5206909.1055298.4351807,0,.8456421-.2113647,1.0979614-.5653687l6.9192505-9.7077637C37.8272145,3.3644409,31.7802174,0,24.9450124,0H3.3599904C1.5043217,0,.000005,1.5043167.000005,3.3599854v30.1316528l3.2920909-4.6190085Z"/></g><path id="Tagline_-_Purple" class="cls-3" d="M67.839381,61.6763437c-1.0007553,0-1.9159114-.1711984-2.7467271-.5135952-.8295569-.3423968-1.5483384-.8333333-2.1538268-1.4728097-.6067472-.6382175-1.0775428-1.3960222-1.4136455-2.2721551-.3348439-.8761329-.5035247-1.8340886-.5035247-2.8751259,0-1.0020141.1774924-1.9297583.5337362-2.7870091.3562437-.8559919.8496979-1.6075025,1.4816213-2.2532729.6331823-.6445116,1.3708459-1.1455186,2.2142497-1.5017623.842145-.3549849,1.7585599-.5337362,2.7467271-.5337362.6722054,0,1.3242699.0994461,1.9561934.2970796s1.2122356.4707956,1.7396777.8194864c.5261833.3499496.9680262.755287,1.3230111,1.2160121l-1.6402316,1.7975831c-.3423968-.3549849-.694864-.6545821-1.056143-.8987915-.3625378-.2429507-.7389225-.427996-1.1266365-.5526183-.3889728-.1258812-.7880161-.1888218-1.1958711-.1888218-.6067472,0-1.1757301.1132931-1.7094663.3361027-.5337362.2240685-.9944612.541289-1.383434.949144s-.694864.8924975-.9189325,1.4526687-.3361027,1.1820242-.3361027,1.8668177c0,.6986405.1082578,1.3318228.3260322,1.8970292.2177744.5677241.5274421,1.0548842.929003,1.4627392.4015609.4091138.882427.7212991,1.4425982.9390735s1.1757301.3260322,1.8479355.3260322c.43429,0,.8559919-.0591641,1.2651057-.1774924.407855-.1195871.7867573-.2870091,1.1354481-.5047835.3499496-.2165156.668429-.4707956.9592145-.7603223l1.2638469,2.0354985c-.3159617.3549849-.7376636.6784995-1.2638469.9680262-.5274421.2895267-1.116566.5173716-1.7686304.6822759-.6520645.1636455-1.3016113.2467271-1.9473817.2467271ZM79.8157153,61.6763437c-1.0410373,0-1.9700403-.234139-2.7870091-.7011581-.8169688-.4682779-1.4614804-1.1102719-1.9360524-1.9272407s-.7112286-1.7459718-.7112286-2.7870091c0-1.0397784.2366566-1.9687815.7112286-2.7857503s1.1190836-1.4589627,1.9360524-1.9272407c.8169688-.4670191,1.7459718-.7011581,2.7870091-.7011581,1.0271903,0,1.9498993.234139,2.7668681.7011581.81571.4682779,1.4589627,1.1102719,1.9259819,1.9272407.4682779.8169688.7024169,1.7459718.7024169,2.7857503,0,1.0410373-.234139,1.9700403-.7024169,2.7870091-.4670191.8169688-1.1102719,1.4589627-1.9259819,1.9272407-.8169688.4670191-1.7396777.7011581-2.7668681.7011581ZM79.8157153,59.522517c.5664653,0,1.0699899-.1447633,1.5118328-.4355488.4405841-.2895267.7905337-.6772407,1.0473313-1.1656596.2567976-.4871601.3789023-1.0397784.3650554-1.6603726.0138469-.6319235-.1082578-1.1920947-.3650554-1.6792548s-.6067472-.8723565-1.0473313-1.1555891c-.4418429-.2832326-.9453676-.4254783-1.5118328-.4254783s-1.0775428.1422457-1.5319738.4254783-.8068983.6709466-1.0574018,1.1656596c-.2505035.4934542-.3751259,1.0511078-.3751259,1.6691843,0,.6205942.1246224,1.1732125.3751259,1.6603726.2505035.4884189.6029708.8761329,1.0574018,1.1656596.454431.2907855.9655086.4355488,1.5319738.4355488ZM87.344668,61.4787103v-10.414149h2.3917422l.0390232,2.0946626-.3952669.157351Line truncated
|
||||
|
Before Width: | Height: | Size: 23 KiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 245.4992501 66.0242793"><defs><style>.cls-1{fill:url(#New_Gradient_Swatch_1);}.cls-1,.cls-2,.cls-3,.cls-4{stroke-width:0px;}.cls-2{fill:url(#New_Gradient_Swatch_1-2);}.cls-3{fill:#5850eb;}.cls-4{fill:#1f2961;}</style><linearGradient id="New_Gradient_Swatch_1" x1="14.8413403" y1="22.5436904" x2="27.4731407" y2="44.6493411" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#909cf7"/><stop offset="1" stop-color="#4b38d8"/></linearGradient><linearGradient id="New_Gradient_Swatch_1-2" x1="7.9837957" y1="-1.3582919" x2="21.0009873" y2="21.4217935" xlink:href="#New_Gradient_Swatch_1"/></defs><g id="Plausible_-_Branding"><g id="CE_Gradient_Logo_-_Purple_Gradient_on_White"><g id="Symbol_-_Purple_Gradient"><path class="cls-1" d="M45.2456059,22.6027536c-1.0911024,10.4557623-10.2327486,18.2272825-20.7452872,18.2272807h-4.047804v9.570007c0,5.3019285-4.2980623,9.5999908-9.5999908,9.5999908H3.3599854c-1.8556687,0-3.3599854-1.5043167-3.3599854-3.3599854v-19.7025146l5.0380685-7.0686343c.9118097-1.2793096,2.587965-1.7566996,4.0369945-1.1497867l2.8657142,1.2002785c1.4444817.6050081,3.1153774.12945,4.0247968-1.1455083l6.7172007-9.417163c.9071158-1.2717288,2.5743943-1.7450816,4.0144283-1.1397262l5.5198678,2.3204187c1.4430268.6066135,3.1137697.1319561,4.0223175-1.1427389l6.4594145-9.0625757c2.0248091,3.5597961,3.0145069,7.7887694,2.5468032,12.2706573Z"/><path class="cls-2" d="M3.2920959,28.8726296c.82329-1.1551271,2.0209115-2.0434967,3.4138697-2.3114381,1.0861554-.2089265,2.156905-.0992829,3.1472499.3155174l2.8649902,1.1999512c.1651001.0691528.3388672.104187.5164795.104187.4365845,0,.8488159-.2124634,1.1026611-.5683594l6.5942097-9.2447929c.8231505-1.154021,2.0204067-2.0410099,3.4124878-2.3083136,1.0821376-.2077892,2.1463585-.0989034,3.1282512.3138487l5.5198364,2.3204346c.1665649.0700684.3417969.1055298.5206909.1055298.4351807,0,.8456421-.2113647,1.0979614-.5653687l6.9192505-9.7077637C37.8272145,3.3644409,31.7802174,0,24.9450124,0H3.3599904C1.5043217,0,.000005,1.5043167.000005,3.3599854v30.1316528l3.2920909-4.6190085Z"/></g><path id="Tagline_-_Purple" class="cls-3" d="M67.839381,61.6763437c-1.0007553,0-1.9159114-.1711984-2.7467271-.5135952-.8295569-.3423968-1.5483384-.8333333-2.1538268-1.4728097-.6067472-.6382175-1.0775428-1.3960222-1.4136455-2.2721551-.3348439-.8761329-.5035247-1.8340886-.5035247-2.8751259,0-1.0020141.1774924-1.9297583.5337362-2.7870091.3562437-.8559919.8496979-1.6075025,1.4816213-2.2532729.6331823-.6445116,1.3708459-1.1455186,2.2142497-1.5017623.842145-.3549849,1.7585599-.5337362,2.7467271-.5337362.6722054,0,1.3242699.0994461,1.9561934.2970796s1.2122356.4707956,1.7396777.8194864c.5261833.3499496.9680262.755287,1.3230111,1.2160121l-1.6402316,1.7975831c-.3423968-.3549849-.694864-.6545821-1.056143-.8987915-.3625378-.2429507-.7389225-.427996-1.1266365-.5526183-.3889728-.1258812-.7880161-.1888218-1.1958711-.1888218-.6067472,0-1.1757301.1132931-1.7094663.3361027-.5337362.2240685-.9944612.541289-1.383434.949144s-.694864.8924975-.9189325,1.4526687-.3361027,1.1820242-.3361027,1.8668177c0,.6986405.1082578,1.3318228.3260322,1.8970292.2177744.5677241.5274421,1.0548842.929003,1.4627392.4015609.4091138.882427.7212991,1.4425982.9390735.5601712.2177744,1.1757301.3260322,1.8479355.3260322.43429,0,.8559919-.0591641,1.2651057-.1774924.407855-.1195871.7867573-.2870091,1.1354481-.5047835.3499496-.2165156.668429-.4707956.9592145-.7603223l1.2638469,2.0354985c-.3159617.3549849-.7376636.6784995-1.2638469.9680262-.5274421.2895267-1.116566.5173716-1.7686304.6822759-.6520645.1636455-1.3016113.2467271-1.9473817.2467271ZM79.8157153,61.6763437c-1.0410373,0-1.9700403-.234139-2.7870091-.7011581-.8169688-.4682779-1.4614804-1.1102719-1.9360524-1.9272407s-.7112286-1.7459718-.7112286-2.7870091c0-1.0397784.2366566-1.9687815.7112286-2.7857503s1.1190836-1.4589627,1.9360524-1.9272407c.8169688-.4670191,1.7459718-.7011581,2.7870091-.7011581,1.0271903,0,1.9498993.234139,2.7668681.7011581.81571.4682779,1.4589627,1.1102719,1.9259819,1.9272407.4682779.8169688.7024169,1.7459718.7024169,2.7857503,0,1.0410373-.234139,1.9700403-.7024169,2.7870091-.4670191.8169688-1.1102719,1.4589627-1.9259819,1.9272407-.8169688.4670191-1.7396777.7011581-2.7668681.7011581ZM79.8157153,59.522517c.5664653,0,1.0699899-.1447633,1.5118328-.4355488.4405841-.2895267.7905337-.6772407,1.0473313-1.1656596.2567976-.4871601.3789023-1.0397784.3650554-1.6603726.0138469-.6319235-.1082578-1.1920947-.3650554-1.6792548s-.6067472-.8723565-1.0473313-1.1555891c-.4418429-.2832326-.9453676-.4254783-1.5118328-.4254783s-1.0775428.1422457-1.5319738.4254783-.8068983.6709466-1.0574018,1.1656596c-.2505035.4934542-.3751259,1.0511078-.3751259,1.6691843,0,.6205942.1246224,1.1732125.3751259,1.6603726.2505035.4884189.6029708.8761329,1.0574018,1.1656596.454431.2907855.9655086.4355488,1.5319738.4355488ZM87.344668,61.4787103v-10.414149h2.3917422l.0390232,2.0946Line truncated
|
||||
|
Before Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,38 @@
|
||||
# Plausible Analytics in Kubernetes
|
||||
|
||||
This guide is designed to extend the [normal self-hosting guide](https://plausible.io/docs/self-hosting), please refer to it before following this guide.
|
||||
|
||||
## 1. Clone the hosting repo
|
||||
|
||||
To deploy Plausible Analytics into Kubernetes first download the [plausible/hosting](https://github.com/plausible/hosting) repo.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/plausible/hosting
|
||||
cd hosting
|
||||
```
|
||||
|
||||
## 2. Add required configuration
|
||||
|
||||
Like the original self hosting guide configure your server in the `plausible-conf.env` file.
|
||||
|
||||
## 3. Deploy the server
|
||||
|
||||
Once you've entered your secret key base, base url and admin credentials, you're ready to deploy the server:
|
||||
|
||||
```bash
|
||||
kubectl create namespace plausible # Create a new namespace for all resources
|
||||
kubectl -n plausible create secret generic plausible-config --from-env-file=plausible-conf.env # Create a configmap from the plausible-conf.env file
|
||||
# Please change the Postgres and Clickhouse passwords to something more secure here!
|
||||
kubectl -n plausible create secret generic plausible-db-user --from-literal='username=postgres' --from-literal='password=postgres' # Create the Postgres user
|
||||
kubectl -n plausible create secret generic plausible-events-db-user --from-literal='username=clickhouse' --from-literal='password=clickhouse' # Create the Clickhouse user
|
||||
kubectl -n plausible apply -f ./kubernetes
|
||||
```
|
||||
|
||||
You can now navigate to http://{hostname}:8000 and see the login screen.
|
||||
|
||||
When you first log in with your admin credentials, you will be prompted to enter a verification code which has been sent to your email. Please configure your server for SMTP to receive this email. [Here are Plausible's SMTP configuration options](https://plausible.io/docs/self-hosting-configuration#mailersmtp-setup).
|
||||
Otherwise, run this command to verify all users in the database:
|
||||
|
||||
```bash
|
||||
kubectl -n plausible exec statefulset/plausible-db -- /bin/bash -c 'psql -U $POSTGRES_USER -d $POSTGRES_DB -c "UPDATE users SET email_verified = true;"'
|
||||
```
|
||||
@@ -0,0 +1,114 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: plausible-db
|
||||
labels:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: db
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: plausible-db
|
||||
labels:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: plausible-db
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
# see https://github.com/docker-library/postgres/blob/6bbf1c7b308d1c4288251d73c37f6caf75f8a3d4/14/buster/Dockerfile
|
||||
securityContext:
|
||||
runAsUser: 999
|
||||
runAsGroup: 999
|
||||
fsGroup: 999
|
||||
containers:
|
||||
- name: plausible-db
|
||||
image: postgres:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: plausible
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: password
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: 1500m
|
||||
requests:
|
||||
memory: 65Mi
|
||||
cpu: 15m
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- pg_isready -U postgres
|
||||
initialDelaySeconds: 20
|
||||
failureThreshold: 6
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- pg_isready -U postgres
|
||||
initialDelaySeconds: 30
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
labels:
|
||||
app.kubernetes.io/name: postgres
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: 128Mi
|
||||
limits:
|
||||
storage: 15Gi
|
||||
@@ -0,0 +1,150 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: plausible-events-db
|
||||
labels:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: db
|
||||
port: 8123
|
||||
targetPort: 8123
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: plausible-events-db-config
|
||||
data:
|
||||
clickhouse-config.xml: |
|
||||
<yandex>
|
||||
<logger>
|
||||
<level>warning</level>
|
||||
<console>true</console>
|
||||
</logger>
|
||||
|
||||
<!-- Stop all the unnecessary logging -->
|
||||
<query_thread_log remove="remove"/>
|
||||
<query_log remove="remove"/>
|
||||
<text_log remove="remove"/>
|
||||
<trace_log remove="remove"/>
|
||||
<metric_log remove="remove"/>
|
||||
<asynchronous_metric_log remove="remove"/>
|
||||
</yandex>
|
||||
clickhouse-user-config.xml: |
|
||||
<yandex>
|
||||
<profiles>
|
||||
<default>
|
||||
<log_queries>0</log_queries>
|
||||
<log_query_threads>0</log_query_threads>
|
||||
</default>
|
||||
</profiles>
|
||||
</yandex>
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: plausible-events-db
|
||||
labels:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: plausible-events-db
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
# see https://github.com/ClickHouse/ClickHouse/blob/master/docker/server/Dockerfile
|
||||
securityContext:
|
||||
runAsUser: 101
|
||||
runAsGroup: 101
|
||||
fsGroup: 101
|
||||
containers:
|
||||
- name: plausible-events-db
|
||||
image: yandex/clickhouse-server:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8123
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/clickhouse
|
||||
- name: config
|
||||
mountPath: /etc/clickhouse-server/config.d/logging.xml
|
||||
subPath: clickhouse-config.xml
|
||||
readOnly: true
|
||||
- name: config
|
||||
mountPath: /etc/clickhouse-server/users.d/logging.xml"
|
||||
subPath: clickhouse-user-config.xml
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CLICKHOUSE_DB
|
||||
value: plausible
|
||||
- name: CLICKHOUSE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: username
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: password
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: 1500m
|
||||
requests:
|
||||
memory: 80Mi
|
||||
cpu: 10m
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /ping
|
||||
port: 8123
|
||||
initialDelaySeconds: 20
|
||||
failureThreshold: 6
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /ping
|
||||
port: 8123
|
||||
initialDelaySeconds: 30
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: plausible-events-db-config
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
labels:
|
||||
app.kubernetes.io/name: clickhouse
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: 128Mi
|
||||
limits:
|
||||
storage: 20Gi
|
||||
@@ -0,0 +1,70 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: plausible-smtp
|
||||
labels:
|
||||
app.kubernetes.io/name: smtp
|
||||
app.kubernetes.io/component: email
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: smtp
|
||||
port: 25
|
||||
targetPort: 25
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: smtp
|
||||
app.kubernetes.io/component: email
|
||||
app.kubernetes.io/part-of: plausible
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: plausible-smtp
|
||||
labels:
|
||||
app.kubernetes.io/name: smtp
|
||||
app.kubernetes.io/component: email
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: smtp
|
||||
app.kubernetes.io/component: email
|
||||
app.kubernetes.io/part-of: plausible
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: smtp
|
||||
app.kubernetes.io/component: email
|
||||
app.kubernetes.io/part-of: plausible
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- name: plausible-smtp
|
||||
image: bytemark/smtp:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 25
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 512Mi
|
||||
cpu: 500m
|
||||
requests:
|
||||
memory: 5Mi
|
||||
cpu: 1m
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 25
|
||||
initialDelaySeconds: 20
|
||||
failureThreshold: 6
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: 25
|
||||
initialDelaySeconds: 30
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
@@ -0,0 +1,150 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: plausible
|
||||
labels:
|
||||
app.kubernetes.io/name: plausible
|
||||
app.kubernetes.io/component: server
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- name: http
|
||||
port: 8000
|
||||
targetPort: 8000
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: plausible
|
||||
app.kubernetes.io/component: server
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: plausible
|
||||
labels:
|
||||
app.kubernetes.io/name: plausible
|
||||
app.kubernetes.io/component: server
|
||||
spec:
|
||||
# Plausible is not currently designed to run in a clustered scenario. Increasing the replicas of this deployment is highly NOT recommended!
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: plausible
|
||||
app.kubernetes.io/component: server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: plausible
|
||||
app.kubernetes.io/component: server
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
# see https://github.com/plausible/analytics/blob/master/Dockerfile
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
initContainers:
|
||||
- name: plausible-init
|
||||
image: plausible/analytics:latest
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-c"
|
||||
args:
|
||||
- sleep 30 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: plausible-config
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: password
|
||||
- name: CLICKHOUSE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: username
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: password
|
||||
- name: DATABASE_URL
|
||||
value: postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(PLAUSIBLE_DB_SERVICE_HOST):$(PLAUSIBLE_DB_SERVICE_PORT)/plausible
|
||||
- name: CLICKHOUSE_DATABASE_URL
|
||||
value: http://$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)@$(PLAUSIBLE_EVENTS_DB_SERVICE_HOST):$(PLAUSIBLE_EVENTS_DB_SERVICE_PORT)/plausible
|
||||
- name: SMTP_HOST_ADDR
|
||||
value: $(PLAUSIBLE_SMTP_SERVICE_HOST)
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: 1500m
|
||||
requests:
|
||||
memory: 50Mi
|
||||
cpu: 10m
|
||||
containers:
|
||||
- name: plausible
|
||||
image: plausible/analytics:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: plausible-config
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: password
|
||||
- name: CLICKHOUSE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: username
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: password
|
||||
- name: DATABASE_URL
|
||||
value: postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(PLAUSIBLE_DB_SERVICE_HOST):$(PLAUSIBLE_DB_SERVICE_PORT)/plausible
|
||||
- name: CLICKHOUSE_DATABASE_URL
|
||||
value: http://$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)@$(PLAUSIBLE_EVENTS_DB_SERVICE_HOST):$(PLAUSIBLE_EVENTS_DB_SERVICE_PORT)/plausible
|
||||
- name: SMTP_HOST_ADDR
|
||||
value: $(PLAUSIBLE_SMTP_SERVICE_HOST)
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: 1500m
|
||||
requests:
|
||||
memory: 140Mi
|
||||
cpu: 10m
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 35
|
||||
failureThreshold: 6
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 45
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
@@ -1,3 +0,0 @@
|
||||
BASE_URL=replace-me
|
||||
SECRET_KEY_BASE=replace-me
|
||||
TOTP_VAULT_KEY=replace-me
|
||||
@@ -38,7 +38,7 @@ $ docker-compose -f docker-compose.yml -f reverse-proxy/traefik/docker-compose.t
|
||||
Install the necessary Apache modules and restart Apache. Edit the file `reverse-proxy/apache2/plausible.conf` to contain the domain name you use for your server, then copy it into Apache's configuration folder. Enable it by creating a symlink in Apache's enabled sites folder with `a2ensite` command. Finally use Certbot to create a TLS certificate for your site:
|
||||
|
||||
```shell
|
||||
$ sudo a2enmod proxy proxy_http proxy_ajp remoteip headers proxy_wstunnel
|
||||
$ sudo a2enmod proxy proxy_http proxy_ajp remoteip headers
|
||||
$ sudo systemctl restart apache2
|
||||
$ sudo cp reverse-proxy/apache2/plausible.conf /etc/apache2/sites-available/
|
||||
$ sudo a2ensite plausible.conf
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
ServerName example.com
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyAddHeaders On
|
||||
ProxyPassMatch ^/(live/websocket)$ ws://localhost:8000/$1
|
||||
ProxyPass / http://localhost:8000/
|
||||
ProxyPassReverse / http://localhost:8000/
|
||||
|
||||
|
||||
@@ -8,12 +8,5 @@ server {
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
location = /live/websocket {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
Guide to upgrading PostgreSQL version `>= 12` to version `14` using `pg_dump` and `psql`. Based on [Upgrade a PostgreSQL database with docker.](https://hollo.me/devops/upgrade-postgresql-database-with-docker.html)
|
||||
|
||||
**Note:** following this guide you'd need to stop some containers and it would make your plausible instance temporarily unavailable.
|
||||
|
||||
---
|
||||
|
||||
### Plan
|
||||
|
||||
1. dump contents of the old version PostgreSQL to a file
|
||||
1. copy the dump to the host
|
||||
1. replace old version PostgreSQL with new version PostgreSQL
|
||||
1. copy and load the dump into new version PostgreSQL
|
||||
|
||||
---
|
||||
|
||||
### Steps
|
||||
|
||||
1. Stop `plausible` to avoid writing to old `plausible_db`
|
||||
|
||||
```console
|
||||
> docker compose stop plausible
|
||||
[+] Running 2/2
|
||||
⠿ Container hosting-plausible-1 Stopped 6.5s
|
||||
```
|
||||
|
||||
2. Dump old `plausible_db` contents to a backup file
|
||||
|
||||
```console
|
||||
> docker compose exec plausible_db sh -c "pg_dump -U postgres plausible_db > plausible_db.bak"
|
||||
```
|
||||
|
||||
3. Copy the backup to the host
|
||||
|
||||
```console
|
||||
> docker compose cp plausible_db:plausible_db.bak plausible_db.bak
|
||||
```
|
||||
|
||||
4. (Optional) verify backup went OK
|
||||
|
||||
```console
|
||||
> head plausible_db.bak
|
||||
--
|
||||
-- PostgreSQL database dump
|
||||
--
|
||||
|
||||
-- Dumped from database version 12.12 (Debian 12.12-1.pgdg110+1)
|
||||
-- Dumped by pg_dump version 12.12 (Debian 12.12-1.pgdg110+1)
|
||||
|
||||
SET statement_timeout = 0;
|
||||
SET lock_timeout = 0;
|
||||
SET idle_in_transaction_session_timeout = 0;
|
||||
```
|
||||
|
||||
5. Edit `docker-compose.yml` to use new PostgreSQL version, here we update from `v12` to `v14`, alpine flavour.
|
||||
|
||||
```diff
|
||||
plausible_db:
|
||||
- image: postgres:12
|
||||
+ image: postgres:14-alpine
|
||||
restart: always
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
```
|
||||
|
||||
6. Ensure relevant containers are stopped
|
||||
|
||||
```console
|
||||
> docker compose stop plausible plausible_db
|
||||
[+] Running 2/2
|
||||
⠿ Container hosting-plausible-1 Stopped 0.0s
|
||||
⠿ Container hosting-plausible_db-1 Stopped 0.2s
|
||||
```
|
||||
|
||||
7. Remove old `plausible_db` container to be able to nuke its volume in the next step
|
||||
|
||||
```console
|
||||
> docker compose rm plausible_db
|
||||
? Going to remove hosting-plausible_db-1 Yes
|
||||
[+] Running 1/0
|
||||
⠿ Container hosting-plausible_db-1 Removed 0.0s
|
||||
```
|
||||
|
||||
8. Remove old `plausible_db` volume, mine is named `hosting_db-data`
|
||||
|
||||
```console
|
||||
> docker volume ls
|
||||
DRIVER VOLUME NAME
|
||||
<...snip...>
|
||||
local hosting_db-data
|
||||
local hosting_event-data
|
||||
<...snip...>
|
||||
|
||||
> docker volume rm hosting_db-data
|
||||
hosting_db-data
|
||||
```
|
||||
|
||||
9. Start new version `plausible_db` container
|
||||
|
||||
```console
|
||||
> docker compose up plausible_db -d
|
||||
[+] Running 9/9
|
||||
⠿ plausible_db Pulled 9.3s
|
||||
⠿ 9b18e9b68314 Already exists 0.0s
|
||||
⠿ 75aada9edfc5 Pull complete 1.2s
|
||||
⠿ 820773693750 Pull complete 1.2s
|
||||
⠿ 8812bb04ef2e Pull complete 5.2s
|
||||
⠿ 2ccec0f7805c Pull complete 5.2s
|
||||
⠿ 833f9b98598e Pull complete 5.3s
|
||||
⠿ 1eb578dc04e6 Pull complete 5.4s
|
||||
⠿ c873bf6204df Pull complete 5.4s
|
||||
[+] Running 2/2
|
||||
⠿ Volume "hosting_db-data" Created 0.0s
|
||||
⠿ Container hosting-plausible_db-1 Started 0.5s
|
||||
```
|
||||
|
||||
10. Create new DB and load data into it
|
||||
|
||||
```console
|
||||
> docker compose exec plausible_db createdb -U postgres plausible_db
|
||||
> docker compose cp plausible_db.bak plausible_db:plausible_db.bak
|
||||
|
||||
> docker compose exec plausible_db sh -c "psql -U postgres -d plausible_db < plausible_db.bak"
|
||||
SET
|
||||
SET
|
||||
SET
|
||||
SET
|
||||
SET
|
||||
set_config
|
||||
------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SET
|
||||
SET
|
||||
SET
|
||||
SET
|
||||
CREATE EXTENSION
|
||||
<...snip...>
|
||||
```
|
||||
|
||||
11. Start all other containers
|
||||
|
||||
```console
|
||||
> docker compose up -d
|
||||
[+] Running 4/4
|
||||
⠿ Container hosting-plausible_events_db-1 Running 0.0s
|
||||
⠿ Container hosting-mail-1 Running 0.0s
|
||||
⠿ Container hosting-plausible_db-1 Started 0.5s
|
||||
⠿ Container hosting-plausible-1 Started 0.5s
|
||||
```
|
||||
|
||||
12. (Optional) Remove backups from the container and the host
|
||||
|
||||
```console
|
||||
> rm plausible_db.bak
|
||||
> docker compose exec plausible_db rm plausible_db.bak
|
||||
```
|
||||