Skip to content

Commit 0ce94fd

Browse files
author
Ruslan Baidan
committed
Merge remote-tracking branch 'origin/master' into copilot/add-swagger-files-renderer
* origin/master: Removed the platform ignore option frome the composer packages update as it is not needed anymore. Fixed the stats-service and postgrtes containers launch. Fixed the docker run and made it possible to use the BackOffice common DB. Address code review feedback - fix Poetry flag, quoting, and unused file Update main README and add Docker installation guide Add helper script and improve documentation Fix Docker configuration and improve setup Add Docker development environment setup files Initial plan Fixed the issue of the analysis creation based on a model with context fields. Update the frontoffice dependency with the fix of the global assets import with evals.
2 parents 455757b + fe5741e commit 0ce94fd

20 files changed

+2159
-388
lines changed

.dockerignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Git files
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Documentation
7+
README.md
8+
CHANGELOG.md
9+
AUTHORS
10+
LICENSE
11+
SECURITY.md
12+
*.md
13+
14+
# Development files
15+
vagrant/
16+
wsl/
17+
INSTALL/
18+
.idea
19+
.vscode
20+
.DS_Store
21+
22+
# Dependencies (will be installed in container)
23+
vendor/
24+
node_modules/
25+
26+
# Data directories (will be mounted as volumes)
27+
data/
28+
29+
# Build artifacts
30+
public/css/
31+
public/js/
32+
public/img/
33+
public/flags/
34+
public/views/
35+
36+
# Logs
37+
*.log
38+
npm-debug.log
39+
40+
# Cache
41+
*.cache
42+
.docker-initialized
43+
44+
# Environment files (should be configured separately)
45+
.env
46+
.env.dev

.env.dev

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MariaDB Configuration
2+
DBHOST=fodb
3+
DBPORT_HOST=3307
4+
DBPASSWORD_ADMIN=root
5+
DBNAME_COMMON=monarc_common
6+
DBNAME_CLI=monarc_cli
7+
DBUSER_MONARC=sqlmonarcuser
8+
DBPASSWORD_MONARC=sqlmonarcuser
9+
# Set USE_BO_COMMON=1 and DBHOST to the BackOffice DB host to reuse monarc_common.
10+
USE_BO_COMMON=1
11+
12+
# Shared Docker network name (must exist when using external network)
13+
MONARC_NETWORK_NAME=monarc-network
14+
15+
# Node.js major version for frontend build tooling
16+
NODE_MAJOR=16
17+
18+
# Optional: set to 0/false/no to disable Xdebug in the image build
19+
XDEBUG_ENABLED=1
20+
XDEBUG_MODE=debug
21+
XDEBUG_START_WITH_REQUEST=trigger
22+
# On Linux, set XDEBUG_CLIENT_HOST to your Docker bridge (often 172.17.0.1).
23+
XDEBUG_CLIENT_HOST=host.docker.internal
24+
XDEBUG_CLIENT_PORT=9003
25+
XDEBUG_IDEKEY=IDEKEY
26+
XDEBUG_DISCOVER_CLIENT_HOST=0
27+
28+
# Stats Service Configuration
29+
STATS_HOST=0.0.0.0
30+
STATS_PORT=5005
31+
STATS_DB_NAME=statsservice
32+
STATS_DB_USER=sqlmonarcuser
33+
STATS_DB_PASSWORD=sqlmonarcuser
34+
# Generate a random secret key for production use:
35+
# openssl rand -hex 32
36+
STATS_SECRET_KEY=changeme_generate_random_secret_key_for_production
37+
# Stats API Key - Leave empty on first run, it will be generated by the stats service
38+
# After first run, get it from the stats service logs or container
39+
STATS_API_KEY=

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: composer validate
4646

4747
- name: Install PHP dependencies
48-
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-req=php
48+
run: composer install --prefer-dist --no-progress --no-suggest
4949

5050
- name: Create synlinks for MONARC PHP modules
5151
run: |

.github/workflows/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: composer validate
3535

3636
- name: Install PHP dependencies
37-
run: composer install --prefer-dist --no-progress --no-suggest --no-dev --ignore-platform-req=php
37+
run: composer install --prefer-dist --no-progress --no-suggest --no-dev
3838

3939
- name: Symlink Monarc modules
4040
run: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ bin/
2323
data/*
2424
!data/fonts
2525
.docker/mariaDb/data/*
26+
.env
27+
.docker-initialized
28+
docker/db_data
29+
.vscode

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@ MONARC Changelog
22
================
33

44

5+
## 2.13.3-p6 (2025-12-18)
6+
7+
### Fix
8+
9+
- [FrontOffice] Fixed the issue of the analysis creation based on a model with context fields.
10+
11+
12+
## 2.13.3-p5 (2025-11-24)
13+
14+
### Fix
15+
16+
- [[FrontOffice] Fix import of global assets](https://github.com/monarc-project/MonarcAppFO/issues/575).
17+
18+
519
## 2.13.3-p4 (2025-07-31)
620

721
### Fix

Dockerfile

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
FROM ubuntu:22.04
2+
3+
ARG XDEBUG_ENABLED=1
4+
ARG XDEBUG_MODE=debug
5+
ARG XDEBUG_START_WITH_REQUEST=trigger
6+
ARG XDEBUG_CLIENT_HOST=host.docker.internal
7+
ARG XDEBUG_CLIENT_PORT=9003
8+
ARG XDEBUG_IDEKEY=IDEKEY
9+
ARG XDEBUG_DISCOVER_CLIENT_HOST=0
10+
ARG NODE_MAJOR=16
11+
12+
# Prevent interactive prompts during package installation
13+
ENV DEBIAN_FRONTEND=noninteractive
14+
ENV LANGUAGE=en_US.UTF-8
15+
ENV LANG=en_US.UTF-8
16+
ENV LC_ALL=en_US.UTF-8
17+
18+
# Install system dependencies
19+
RUN apt-get update && apt-get upgrade -y && \
20+
packages="vim zip unzip git gettext curl gsfonts mariadb-client apache2 php8.1 php8.1-cli \
21+
php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml \
22+
php8.1-bcmath php8.1-intl php8.1-imagick locales wget ca-certificates gnupg \
23+
build-essential python3 pkg-config libcairo2-dev libpango1.0-dev libjpeg-dev \
24+
libgif-dev librsvg2-dev libpixman-1-dev"; \
25+
if [ "$XDEBUG_ENABLED" = "1" ] || [ "$XDEBUG_ENABLED" = "true" ] || [ "$XDEBUG_ENABLED" = "yes" ]; then \
26+
packages="$packages php8.1-xdebug"; \
27+
fi; \
28+
apt-get install -y $packages && \
29+
locale-gen en_US.UTF-8 && \
30+
apt-get clean && \
31+
rm -rf /var/lib/apt/lists/*
32+
33+
# Configure PHP
34+
RUN sed -i 's/upload_max_filesize = .*/upload_max_filesize = 200M/' /etc/php/8.1/apache2/php.ini && \
35+
sed -i 's/post_max_size = .*/post_max_size = 50M/' /etc/php/8.1/apache2/php.ini && \
36+
sed -i 's/max_execution_time = .*/max_execution_time = 100/' /etc/php/8.1/apache2/php.ini && \
37+
sed -i 's/max_input_time = .*/max_input_time = 223/' /etc/php/8.1/apache2/php.ini && \
38+
sed -i 's/memory_limit = .*/memory_limit = 512M/' /etc/php/8.1/apache2/php.ini && \
39+
sed -i 's/session\.gc_maxlifetime = .*/session.gc_maxlifetime = 604800/' /etc/php/8.1/apache2/php.ini && \
40+
sed -i 's/session\.gc_probability = .*/session.gc_probability = 1/' /etc/php/8.1/apache2/php.ini && \
41+
sed -i 's/session\.gc_divisor = .*/session.gc_divisor = 1000/' /etc/php/8.1/apache2/php.ini
42+
43+
# Configure Xdebug for development
44+
RUN if [ "$XDEBUG_ENABLED" = "1" ] || [ "$XDEBUG_ENABLED" = "true" ] || [ "$XDEBUG_ENABLED" = "yes" ]; then \
45+
echo "zend_extension=xdebug.so" > /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
46+
echo "xdebug.mode=${XDEBUG_MODE}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
47+
echo "xdebug.start_with_request=${XDEBUG_START_WITH_REQUEST}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
48+
echo "xdebug.client_host=${XDEBUG_CLIENT_HOST}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
49+
echo "xdebug.client_port=${XDEBUG_CLIENT_PORT}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
50+
echo "xdebug.discover_client_host=${XDEBUG_DISCOVER_CLIENT_HOST}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini && \
51+
echo "xdebug.idekey=${XDEBUG_IDEKEY}" >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini; \
52+
fi
53+
54+
# Enable Apache modules
55+
RUN a2enmod rewrite ssl headers
56+
57+
# Set global ServerName to avoid AH00558 warning
58+
RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf \
59+
&& a2enconf servername
60+
61+
# Install Composer
62+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
63+
64+
# Install Node.js and npm
65+
RUN mkdir -p /etc/apt/keyrings && \
66+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
67+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
68+
apt-get update && \
69+
apt-get install -y nodejs && \
70+
npm install -g grunt-cli && \
71+
apt-get clean && \
72+
rm -rf /var/lib/apt/lists/*
73+
74+
# Set working directory
75+
WORKDIR /var/www/html/monarc
76+
77+
# Configure Apache
78+
RUN echo '<VirtualHost *:80>\n\
79+
ServerName localhost\n\
80+
DocumentRoot /var/www/html/monarc/public\n\
81+
\n\
82+
<Directory /var/www/html/monarc/public>\n\
83+
DirectoryIndex index.php\n\
84+
AllowOverride All\n\
85+
Require all granted\n\
86+
</Directory>\n\
87+
\n\
88+
<IfModule mod_headers.c>\n\
89+
Header always set X-Content-Type-Options nosniff\n\
90+
Header always set X-XSS-Protection "1; mode=block"\n\
91+
Header always set X-Robots-Tag none\n\
92+
Header always set X-Frame-Options SAMEORIGIN\n\
93+
</IfModule>\n\
94+
\n\
95+
SetEnv APP_ENV development\n\
96+
SetEnv APP_DIR /var/www/html/monarc\n\
97+
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
98+
99+
# Allow Apache override to all
100+
RUN sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
101+
102+
# Create necessary directories
103+
RUN mkdir -p /var/www/html/monarc/data/cache \
104+
/var/www/html/monarc/data/LazyServices/Proxy \
105+
/var/www/html/monarc/data/DoctrineORMModule/Proxy \
106+
/var/www/html/monarc/data/import/files
107+
108+
# Copy entrypoint script
109+
COPY docker-entrypoint.sh /usr/local/bin/
110+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
111+
112+
EXPOSE 80
113+
114+
ENTRYPOINT ["docker-entrypoint.sh"]
115+
CMD ["apachectl", "-D", "FOREGROUND"]

Dockerfile.stats

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV LANGUAGE=en_US.UTF-8
5+
ENV LANG=en_US.UTF-8
6+
ENV LC_ALL=en_US.UTF-8
7+
ENV FLASK_APP=app.py
8+
ENV STATS_CONFIG=production.py
9+
10+
# Install dependencies
11+
RUN apt-get update && \
12+
apt-get install -y \
13+
git \
14+
curl \
15+
python3 \
16+
python3-pip \
17+
python3-venv \
18+
nodejs \
19+
npm \
20+
postgresql-client \
21+
locales && \
22+
locale-gen en_US.UTF-8 && \
23+
apt-get clean && \
24+
rm -rf /var/lib/apt/lists/*
25+
26+
# Install Poetry
27+
RUN curl -sSL https://install.python-poetry.org | python3 - && \
28+
ln -s /root/.local/bin/poetry /usr/local/bin/poetry
29+
30+
WORKDIR /var/www/stats-service
31+
32+
# Copy entrypoint script
33+
COPY docker-stats-entrypoint.sh /usr/local/bin/
34+
RUN chmod +x /usr/local/bin/docker-stats-entrypoint.sh
35+
36+
EXPOSE 5005
37+
38+
ENTRYPOINT ["docker-stats-entrypoint.sh"]

0 commit comments

Comments
 (0)