[INFRA-287] Fix: AIO Docker Image build failure (#8311)

* refactor: update build scripts and supervisor configuration

* Changed Caddyfile source in build.sh to use Caddyfile.aio.ce
* Updated Dockerfile to copy web assets from the correct directory
* Modified supervisor.conf to remove web and admin program configurations, and updated space program command to use react-router-serve

* chore: remove obsolete Caddyfile.aio.ce configuration

* chore: clean up Dockerfile by removing redundant cache removal command

* fix: update live program command to use .mjs extension in supervisor configuration

* fix: update live program command in supervisor configuration to remove .mjs extension

* fix: update reverse proxy ports in Caddyfile.aio.ce configuration

* fix: correct reverse proxy addresses in Caddyfile.aio.ce configuration

* refactor: remove outdated reverse proxy address updates from build script
This commit is contained in:
Akshat Jain
2025-12-11 18:06:27 +05:30
committed by GitHub
parent 7b41ffa08e
commit 58e48a995b
4 changed files with 53 additions and 42 deletions

View File

@@ -0,0 +1,46 @@
(plane_proxy) {
request_body {
max_size {$FILE_SIZE_LIMIT}
}
handle /spaces/* {
reverse_proxy localhost:3002
}
handle /live/* {
reverse_proxy locahost:3005
}
handle /api/* {
reverse_proxy localhost:3004
}
handle /auth/* {
reverse_proxy localhost:3004
}
handle_path /god-mode* {
root * /app/admin
try_files {path} {path}/ /index.html
file_server
}
handle_path /* {
root * /app/web
try_files {path} {path}/ /index.html
file_server
}
}
{
{$CERT_EMAIL}
acme_ca {$CERT_ACME_CA:https://acme-v02.api.letsencrypt.org/directory}
{$CERT_ACME_DNS}
servers {
max_header_size 25MB
client_ip_headers X-Forwarded-For X-Real-IP
trusted_proxies static {$TRUSTED_PROXIES:0.0.0.0/0}
}
}
{$SITE_ADDRESS} {
import plane_proxy
}

View File

@@ -31,14 +31,12 @@ COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin
COPY --from=web-img /app /app/web
COPY --from=web-img /usr/share/nginx/html /app/web
COPY --from=space-img /app /app/space
COPY --from=admin-img /app /app/admin
COPY --from=admin-img /usr/share/nginx/html/god-mode /app/admin
COPY --from=live-img /app /app/live
RUN rm -rf /app/web/apps/web/.next/cache && \
rm -rf /app/space/apps/space/.next/cache && \
rm -rf /app/admin/apps/admin/.next/cache
RUN rm -rf /app/space/apps/space/.next/cache
COPY --from=proxy-img /usr/bin/caddy /usr/bin/caddy
COPY dist/Caddyfile /app/proxy/Caddyfile

View File

@@ -95,7 +95,7 @@ update_env_file(){
build_dist_files(){
cp ./variables.env $DIST_DIR/plane.env
cp ../../../apps/proxy/Caddyfile.ce $DIST_DIR/Caddyfile
cp ../../../apps/proxy/Caddyfile.aio.ce $DIST_DIR/Caddyfile
echo "" >> $DIST_DIR/plane.env
echo "" >> $DIST_DIR/plane.env
@@ -108,16 +108,6 @@ build_dist_files(){
update_env_file $DIST_DIR/plane.env "API_BASE_URL" "http://localhost:3004"
update_env_file $DIST_DIR/plane.env "SITE_ADDRESS" ":80"
# remove this line containing `plane-minio:9000`
remove_line $DIST_DIR/Caddyfile "plane-minio:9000" ""
# in caddyfile, update `reverse_proxy /spaces/* space:3000` to `reverse_proxy /spaces/* space:3002`
string_replace $DIST_DIR/Caddyfile "web:3000" "localhost:3001"
string_replace $DIST_DIR/Caddyfile "space:3000" "localhost:3002"
string_replace $DIST_DIR/Caddyfile "admin:3000" "localhost:3003"
string_replace $DIST_DIR/Caddyfile "api:8000" "localhost:3004"
string_replace $DIST_DIR/Caddyfile "live:3000" "localhost:3005"
# print docker build command
echo "------------------------------------------------"

View File

@@ -17,20 +17,9 @@ stderr_logfile_backups=5
priority=10
[program:web]
command=sh -c "node /app/web/apps/web/server.js"
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/web.log
stderr_logfile=/app/logs/error/web.err.log
# stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=5
environment=PORT=3001,HOSTNAME=0.0.0.0
priority=15
[program:space]
command=sh -c "node /app/space/apps/space/server.js"
directory=/app/space/apps/space/build/server
command=sh -c "npx react-router-serve index.js"
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/space.log
@@ -41,18 +30,6 @@ stderr_logfile_backups=5
environment=PORT=3002,HOSTNAME=0.0.0.0
priority=15
[program:admin]
command=sh -c "node /app/admin/apps/admin/server.js"
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/admin.log
stderr_logfile=/app/logs/error/admin.err.log
# stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=5
environment=PORT=3003,HOSTNAME=0.0.0.0
priority=15
[program:api]
directory=/app/backend
command=sh -c "./bin/docker-entrypoint-api.sh"
@@ -96,7 +73,7 @@ priority=20
[program:live]
command=sh -c "node /app/live/apps/live/dist/start.js"
command=sh -c "node /app/live/apps/live"
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/live.log