Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevo David committed Sep 22, 2024
2 parents 4262755 + e981ef3 commit 94170d1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions var/docker/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:5000/ {
handle_path /api/* {
reverse_proxy * localhost:3000
}

handle {
reverse_proxy * localhost:4200
}
}
9 changes: 7 additions & 2 deletions var/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions var/docker/supervisord/caddy.conf
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 94170d1

Please sign in to comment.