Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +19 -5
Dockerfile
CHANGED
|
@@ -73,11 +73,25 @@ RUN echo 'server { listen 7860; server_name _; root /var/www/html; index index.h
|
|
| 73 |
|
| 74 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 75 |
|
| 76 |
-
#
|
| 77 |
-
RUN
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
RUN printf '#!/bin/bash\n\
|
| 82 |
echo "==> Ejecutando migraciones y preparando la base de datos en los modulos..."\n\
|
| 83 |
find /app -name "Gemfile" -not -path "*/vendor/*" -execdir bundle exec rails db:prepare \;\n\
|
|
|
|
| 73 |
|
| 74 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 75 |
|
| 76 |
+
# Parche de seguridad para corregir todas las migraciones inconsistentes del repositorio
|
| 77 |
+
RUN ruby -e ' \
|
| 78 |
+
Dir.glob("/app/**/db/migrate/*.rb").each do |file| \
|
| 79 |
+
content = File.read(file); \
|
| 80 |
+
if file.include?("add_facebook_comment_config_to_agent_bot_inboxes") \
|
| 81 |
+
content = content.gsub(":uuid", ":bigint"); \
|
| 82 |
+
end; \
|
| 83 |
+
if file.include?("create_facebook_comment_moderations") \
|
| 84 |
+
content = content.gsub(":uuid", ":integer").gsub("type: :uuid", "type: :integer"); \
|
| 85 |
+
end; \
|
| 86 |
+
if file.include?("20250819224900_init_schema.rb") \
|
| 87 |
+
content = content.lines.map do |line| \
|
| 88 |
+
(line =~ /add_index\s+:users/ && line !~ /:email\b|:reset_password_token\b/) ? "# #{line}" : line \
|
| 89 |
+
end.join; \
|
| 90 |
+
end; \
|
| 91 |
+
File.write(file, content); \
|
| 92 |
+
end'
|
| 93 |
+
|
| 94 |
+
# Entrypoint: ejecuta db:prepare en los módulos de backend
|
| 95 |
RUN printf '#!/bin/bash\n\
|
| 96 |
echo "==> Ejecutando migraciones y preparando la base de datos en los modulos..."\n\
|
| 97 |
find /app -name "Gemfile" -not -path "*/vendor/*" -execdir bundle exec rails db:prepare \;\n\
|