Commit 392c7ac5 authored by Gaëtan Blond's avatar Gaëtan Blond
Browse files
parents 6b19a604 53083932
# Castopod
Castopod est un service de podcast en ligne disponible à l'adresse [https://podcast.picasoft.net](https://podcast.picasoft.net). Le service est découpé en 3 conteneurs, un service de base de données MySQL, un conteneur qui s'occupe des traitements PHP (`back`) et un conteneur qui sert le contenu statique (`front`).
## Mettre à jour
Il suffit de mettre à jour le numéro de version dans le fichier `docker-compose.yml` et dans les `Dockerfile` du `front` **et** du `back`. Puis on lance un `docker-compose build`.
**Attention** : Le logiciel est encore en *alpha* les migrations des bases de données ne sont pas encore faites automatiquement, il faut vérifier les notes de release et les faire le cas échéant.
## Installation
Remplir les fichiers situés dans `secrets` et lancer le tout. Se rendre vers `/cp-auth` pour finir l'installation et créer le compte administrateur. Ensuite pour se connecter il faut se rendre vers `/cp-auth/login`, l'interface d'administration est disponible sur `/cp-admin`.
FROM alpine:3.13 AS downloader
ARG VERSION=v1.0.0-alpha.57
RUN apk add --no-cache curl jq && \
curl -L $(curl https://code.podlibre.org/api/v4/projects/2/releases/${VERSION}/assets/links | jq -r .[].url | grep \.tar\.gz) -o castopod.tgz && \
tar -xzf castopod.tgz
FROM php:7.4-fpm-alpine3.13
COPY entrypoint.sh /entrypoint.sh
COPY uploads.ini /usr/local/etc/php/conf.d/uploads.ini
RUN echo "* * * * * /usr/local/bin/php /castopod/public/index.php scheduled-activities" > /crontab.txt
RUN apk add --no-cache libpng icu-libs freetype libwebp libjpeg-turbo libxpm && \
apk add --no-cache --virtual .php-ext-build-dep freetype-dev libpng-dev libjpeg-turbo-dev libwebp-dev zlib-dev libxpm-dev icu-dev && \
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm && \
docker-php-ext-install gd intl mysqli && \
docker-php-ext-enable mysqli gd intl && \
apk del .php-ext-build-dep
COPY --from=downloader /castopod-host /castopod
RUN chmod 544 /entrypoint.sh && \
chmod 444 /crontab.txt && \
/usr/bin/crontab /crontab.txt
WORKDIR /castopod
VOLUME /castopod/public/media
ENTRYPOINT [ "sh", "-c" ]
CMD [ "/entrypoint.sh" ]
#!/bin/sh
/usr/sbin/crond -f /crontab.txt -L /dev/stdout &
/usr/local/sbin/php-fpm
file_uploads = On
memory_limit = 512M
upload_max_filesize = 500M
post_max_size = 512M
max_execution_time = 300
version: "3.7"
volumes:
castopod-media:
name: "castopod-media"
castopod-db:
name: "castopod-db"
networks:
proxy:
external: true
castopod-app:
name: "castopod"
castopod-db:
name: "castopod-db"
services:
app-back:
image: registry.picasoft.net/pica-castopod-back:v2.0.0-alpha.57
build: back
container_name: "castopod-back"
volumes:
- ./secrets/cp_env.secrets:/castopod/.env
- castopod-media:/castopod/public/media
networks:
- castopod-app
- castopod-db
restart: unless-stopped
app-front:
image: registry.picasoft.net/pica-castopod-front:v1.0.0-alpha.57
build: front
container_name: "castopod-front"
networks:
- castopod-app
- proxy
volumes:
- castopod-media:/var/www/html/media:ro
labels:
traefik.http.routers.castopod.entrypoints: websecure
traefik.http.routers.castopod.rule: Host(`podcast.picasoft.net`)
traefik.http.services.castopod.loadbalancer.server.port: 80
traefik.enable: true
restart: unless-stopped
db:
image: mariadb:10.5
container_name: "castopod-db"
networks:
- castopod-db
volumes:
- castopod-db:/var/lib/mysql
env_file:
- ./secrets/castopod-db.secrets
restart: unless-stopped
FROM alpine:3.13 AS downloader
ARG VERSION=v1.0.0-alpha.57
RUN apk add --no-cache curl jq && \
curl -L $(curl https://code.podlibre.org/api/v4/projects/2/releases/${VERSION}/assets/links | jq -r .[].url | grep \.tar\.gz) -o castopod.tgz && \
tar -xzf castopod.tgz
FROM nginx:1.19-alpine
VOLUME /var/www/html/media
WORKDIR /var/www/html
RUN apk add --no-cache curl
HEALTHCHECK --interval=30s --timeout=3s CMD curl --fail http://localhost || exit 1
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=downloader /castopod-host/public /var/www/html
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
real_ip_header X-Real-IP;
upstream php-handler {
server app-back:9000;
}
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
client_max_body_size 1G;
fastcgi_buffers 64 4K;
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_types application/atom+xml application/javascript audio/mpeg application/rss+xml image/bmp image/png image/jpeg image/svg+xml image/x-icon text/css text/plain text/html;
location ~ /(assets|media)/.*$ {
try_files $uri =404;
}
location / {
fastcgi_param SCRIPT_FILENAME /castopod/public/index.php;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass php-handler;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME /castopod/public/$fastcgi_script_name;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass php-handler;
}
}
}
MYSQL_DATABASE=castopod
MYSQL_ROOT_PASSWORD=changeme
MYSQL_USER=castopod
MYSQL_PASSWORD=changeme
# Instance configuration
app.baseURL="https://podcast.test.picasoft.net/"
app.mediaBaseURL=""
app.adminGateway="cp-admin"
app.authGateway="cp-auth"
# Database configuration
database.default.hostname="castopod-db"
database.default.database="castopod"
database.default.username="castopod"
database.default.password="changeme"
database.default.DBPrefix="cp_"
# Cache configuration (advanced)
# Keep as is if you don't know what this means
cache.handler="file"
ARG VERSION=2.3.2
ARG VERSION=2.4.1
ARG PORTCHECKER_VERSION=v1.0.6
ARG SCVERSION=v0.1.12
......
......@@ -25,7 +25,7 @@ services:
restart: unless-stopped
codimd-app:
image: registry.picasoft.net/pica-codimd:2.3.2
image: registry.picasoft.net/pica-codimd:2.4.1
build: .
container_name: codimd-app
volumes:
......
......@@ -69,5 +69,29 @@
"Day": 7,
"Week": 4,
"Month": 12
},
"castopod": {
"Folder": "castopod",
"Backup-Rota": {
"Hour": 24,
"Day": 7,
"Week": 4,
"Month": 12
},
"peertube": {
"Folder": "peertube",
"Backup-Rota": {
"Hour": 24,
"Day": 7,
"Week": 4,
"Month": 12
},
"lufi": {
"Folder": "lufi",
"Backup-Rota": {
"Hour": 24,
"Day": 7,
"Week": 4,
"Month": 12
}
}
......@@ -84,5 +84,39 @@
"Folder": "privatebin",
"Cron": "0 */6 * * *",
"Init-Backup": "1"
},
"castopod": {
"Host": "castopod-db",
"Port": "3306",
"User": "CASTOPOD_DB_USER",
"Password": "CASTOPOD_DB_PASSWORD",
"Database": "castopod",
"Type": "mysql",
"Folder": "castopod",
"Cron": "0 */6 * * *",
"Options":"",
"Init-Backup": "1"
},
"peertube": {
"Host": "peertube-db",
"Port": "5432",
"User": "PEERTUBE_DB_USER",
"Password": "PEERTUBE_DB_PASSWORD",
"Database": "peertube",
"Type": "postgres",
"Folder": "peertube",
"Cron": "0 */6 * * *",
"Init-Backup": "1"
},
"lufi": {
"Host": "lufidb",
"Port": "5432",
"User": "LUFI_DB_USER",
"Password": "LUFI_DB_PASSWORD",
"Database": "lufi",
"Type": "postgres",
"Folder": "lufi",
"Cron": "0 */6 * * *",
"Init-Backup": "1"
}
}
......@@ -17,6 +17,12 @@ networks:
name: "mattermost"
privatebin:
name: "privatebin"
castopod:
name: "castopod-db"
peertube:
name: "peertube"
lufi:
name: "lufi"
services:
db-backup:
......@@ -37,4 +43,7 @@ services:
- codimd
- mattermost
- privatebin
- castopod
- peertube
- lufi
restart: unless-stopped
......@@ -12,3 +12,9 @@ CODIMD_DB_USER=
CODIMD_DB_PASSWORD=
PRIVATEBIN_DB_USER=
PRIVATEBIN_DB_PASSWORD=
CASTOPOD_DB_USER=
CASTOPOD_DB_PASSWORD=
PEERTUBE_DB_USER=
PEERTUBE_DB_PASSWORD=
LUFI_DB_USER=
LUFI_DB_PASSWORD=
......@@ -12,6 +12,7 @@ networks:
proxy:
external: true
lufi:
name: lufi
services:
lufi:
......
......@@ -60,7 +60,7 @@
# Max file size, in octets
# You can write it 100*1024*1024
# optional, no default
max_file_size => 2048*1024*1024,
max_file_size => 3072*1024*1024,
# If you want to have piwik statistics, provide a piwik image tracker
# Only the image tracker is allowed, no javascript
......
......@@ -4,7 +4,7 @@ FROM alpine:3.11
ENV PATH="/mattermost/bin:${PATH}"
# Picasoft : change these values. The team version is used by default
ENV MM_VERSION=5.34.2
ENV MM_VERSION=5.35.0
# Get these ids with the output of `id mattermost` on the VM hosting the app
ARG PUID=5000
ARG PGID=5000
......
......@@ -17,7 +17,7 @@ volumes:
services:
mattermost:
image: registry.picasoft.net/pica-mattermost:5.34.2
image: registry.picasoft.net/pica-mattermost:5.35.0
build: .
container_name: mattermost-app
volumes:
......
......@@ -16,7 +16,7 @@ volumes:
services:
grafana:
image: grafana/grafana:7.5.4
image: grafana/grafana:7.5.6
container_name: grafana
volumes:
- grafana:/var/lib/grafana
......@@ -39,7 +39,7 @@ services:
restart: unless-stopped
victoria-metrics:
image: victoriametrics/victoria-metrics:v1.58.0
image: victoriametrics/victoria-metrics:v1.59.0
container_name: victoria-metrics
volumes:
- victoria-metrics:/victoria-metrics-data
......@@ -53,7 +53,7 @@ services:
restart: unless-stopped
vmagent:
image: victoriametrics/vmagent:v1.58.0
image: victoriametrics/vmagent:v1.59.0
container_name: vmagent
command:
- "-promscrape.config=/config/vmagent-prom.yml"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment