Commit 50da3d30 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Merge branch 'castopod' into 'master'

Castopod

See merge request !63
parents 43c943bd c86e266a
FROM alpine:3.13 AS downloader
ARG VERSION=v1.0.0-alpha.53
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 /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.53
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.53
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.53
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/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"
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