Files
lasuite-messages/bin/scalingo_postfrontend
BastienandGitHub a67fd36c33 (ops) implement production docker images (#451)
* (ops) implement production docker images

Github workflows:
  - moved docker-publish jobs into a separate file on push main only
Backend:
  - added healthcheck on backend Dockerfile + minor fixes
  - bumped django to 5.1.15 to mitigate major CVE
  - moved /healthz endpoint to /__heartbeat__ + added db connection
    check
Frontend:
  - Added runtime-prod Dockerfile target + minor fixes on the Dockerfile
  - bump next to 15.5.9 to mitigate major CVE
  - moved nginx config to standard nginx container configuration
    template, fixed `scalingo_postfrontend` accordingly
Keycloak:
  - Added production Dockerfile
  - Removed scalingo_pgdump script & cron.json
socks-proxy:
  - added package upgrades run into runtime Dockerfile stage
Misc:
  - removed scalingo_pgdump.sh & cron.json
  - fixed compose and e2e nginx configs with /healthz replacement

* (fix) coderabbit recommandations
2026-01-12 15:18:25 +01:00

26 lines
1.0 KiB
Bash

#!/bin/bash
set -o errexit # always exit on error
set -o pipefail # don't ignore exit codes when piping output
echo "-----> Running post-frontend script"
# Move the frontend build to the nginx root and clean up
mkdir -p build/
mv src/frontend/out build/frontend-out
mv src/backend/* ./
# Replace ${MESSAGES_FRONTEND_BACKEND_SERVER} to the erb equivalent with the "localhost:8000" default value
# Replace ${DJANGO_ADMIN_URL} to the erb equivalent with the "admin" default value
# Replace ${MESSAGES_FRONTEND_ROOT} with the actual frontend root for scalingo
# Replace every other shell variable to its erb equivalent
sed \
-e 's/\${MESSAGES_FRONTEND_BACKEND_SERVER}/<%= ENV["MESSAGES_FRONTEND_BACKEND_SERVER"] || "localhost:8000" %>/g' \
-e 's/\${DJANGO_ADMIN_URL}/<%= ENV["DJANGO_ADMIN_URL"] || "admin" %>/g' \
-e 's|\${MESSAGES_FRONTEND_ROOT}|/app/build/frontend-out|g' \
-e 's/\${\([A-Z_][A-Z0-9_]*\)}/<%= ENV["\1"] %>/g' \
src/frontend/nginx/nginx.conf.template > ./servers.conf.erb
echo "3.13" > .python-version