Merge remote-tracking branch 'origin/main'

This commit is contained in:
Nevo David 2024-09-22 21:00:48 +07:00
commit 94170d1ce1
4 changed files with 28 additions and 3 deletions

View File

@ -14,17 +14,20 @@ ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NEXT_TELEMETRY_DISABLED=1
RUN apk add --no-cache \
caddy \
bash=5.2.21-r0 \
supervisor=4.2.5-r4
WORKDIR /app
EXPOSE 4200
EXPOSE 3000
EXPOSE 4200
EXPOSE 5000
COPY var/docker/entrypoint.sh /app/entrypoint.sh
COPY var/docker/supervisord.conf /etc/supervisord.conf
COPY var/docker/supervisord /app/supervisord_available_configs/
COPY var/docker/Caddyfile /app/Caddyfile
COPY .env.example /config/postiz.env
VOLUME /config

9
var/docker/Caddyfile Normal file
View File

@ -0,0 +1,9 @@
:5000/ {
handle_path /api/* {
reverse_proxy * localhost:3000
}
handle {
reverse_proxy * localhost:4200
}
}

View File

@ -5,8 +5,8 @@ set -o xtrace
if [[ "$SKIP_CONFIG_CHECK" != "true" ]]; then
echo "Entrypoint: Copying /config/postiz.env into /app/.env"
if [ ! -f /config/.env ]; then
echo "Entrypoint: WARNING: No .env file found in /config/postiz.env"
if [ ! -f /config/postiz.env ]; then
echo "Entrypoint: WARNING: No postiz.env file found in /config/postiz.env"
fi
cp -vf /config/postiz.env /app/.env
@ -22,6 +22,11 @@ npm run prisma-db-push
mkdir -p /etc/supervisor.d/
if [[ "$INTERNAL_PROXY_ENABLED" != "false" ]]; then
echo "Entrypoint: Starting internal proxy"
cp -vf /app/supervisord_available_configs/caddy.conf /etc/supervisor.d/
fi
if [[ "$POSTIZ_APPS" == *"frontend"* ]]; then
ln -sf /app/supervisord_available_configs/frontend.conf /etc/supervisor.d/
fi

View File

@ -0,0 +1,8 @@
[program:backend]
directory=/app
command=caddy run --config /app/Caddyfile
autostart=true
autorestart=false
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0