Compare commits

...

8 Commits

Author SHA1 Message Date
gitea-actions
7e5080859d chore: bump version to v0.1.23
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Successful in 2m16s
2026-04-07 12:59:29 +00:00
Matthieu
414916a20d fix(ci) : pin node:22-alpine instead of lts (now node 24 / npm 11)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:59:19 +02:00
gitea-actions
70c05946bd chore: bump version to v0.1.22
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 18s
2026-04-07 12:56:03 +00:00
Matthieu
ede55b9f08 fix(ci) : regenerate package-lock.json for npm ci compatibility
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:55:54 +02:00
gitea-actions
c61b24bea3 chore: bump version to v0.1.21
Some checks failed
Auto Tag Develop / tag (push) Successful in 6s
Build & Push Docker Image / build (push) Failing after 10s
2026-04-07 12:53:26 +00:00
Matthieu
389bfbef13 refactor(infra) : align prod setup with Lesstime pattern
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Single container with supervisord (Nginx + PHP-FPM), 3-stage
Dockerfile build, pre-built image from registry, port 8086.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:53:18 +02:00
gitea-actions
34adb01cbb chore: bump version to v0.1.20
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Successful in 51s
2026-04-07 12:40:39 +00:00
Matthieu
212a37f8dc fix(infra) : hardcode prod port 8086 like other apps
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:40:30 +02:00
7 changed files with 11771 additions and 14973 deletions

View File

@@ -1,2 +1,2 @@
parameters:
app.version: '0.1.19'
app.version: '0.1.23'

26501
frontend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,11 +2,7 @@ APP_ENV=prod
APP_DEBUG=0
APP_SECRET=CHANGE_ME_IN_PRODUCTION
POSTGRES_DB=coltura
POSTGRES_USER=coltura
POSTGRES_PASSWORD=CHANGE_ME_IN_PRODUCTION
APP_PORT=80
DATABASE_URL="postgresql://coltura:CHANGE_ME@host.docker.internal:5432/coltura?serverVersion=16&charset=utf8"
JWT_PASSPHRASE=CHANGE_ME_IN_PRODUCTION
JWT_COOKIE_SECURE=1

View File

@@ -1,88 +1,81 @@
ARG DOCKER_PHP_VERSION=8.4.6
# --- Stage 1: Build backend ---
FROM php:8.4-cli AS backend-build
FROM php:${DOCKER_PHP_VERSION}-fpm-bullseye AS php-base
ARG DOCKER_NODE_VERSION=24.12.0
ENV DOCKER_NODE_VERSION="${DOCKER_NODE_VERSION}"
# Installer les dépendances et extensions PHP nécessaires
RUN apt-get update && apt-get install -y \
libicu-dev \
libpq-dev \
libpng-dev \
libzip-dev \
libxml2-dev \
ca-certificates \
gnupg \
libbz2-dev \
libgmp-dev \
libldap2-dev \
libonig-dev \
libsodium-dev \
libxslt1-dev \
zlib1g-dev \
libssl-dev \
wget \
git \
unzip \
&& docker-php-ext-install -j$(nproc) \
intl \
zip \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
gmp \
ldap \
pcntl \
pdo_pgsql \
soap \
sockets \
sysvsem \
xsl \
&& docker-php-ext-enable opcache \
&& rm -rf /var/lib/apt/lists/* /tmp/*
libicu-dev libpq-dev libpng-dev libzip-dev libxml2-dev \
unzip curl git \
&& docker-php-ext-install -j$(nproc) intl pdo_pgsql zip gd opcache \
&& rm -rf /var/lib/apt/lists/*
# Installation de node
RUN wget -qO- "https://nodejs.org/dist/v${DOCKER_NODE_VERSION}/node-v${DOCKER_NODE_VERSION}-linux-x64.tar.xz" | tar xJC /tmp/ && \
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/bin /usr/ && \
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/include /usr/ && \
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/lib /usr/ && \
cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/share /usr/ && \
rm -rf /tmp/*
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Installation de composer
RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
WORKDIR /app
COPY composer.json composer.lock ./
RUN APP_ENV=prod APP_DEBUG=0 composer install --no-dev --no-scripts --no-interaction
WORKDIR /var/www/html
COPY bin bin/
COPY config config/
COPY migrations migrations/
COPY public public/
COPY src src/
ENV APP_ENV=prod
RUN composer dump-autoload --optimize --no-dev
# Copier les fichiers projet
COPY . /var/www/html
# --- Stage 2: Build frontend ---
FROM node:22-alpine AS frontend-build
# Installation des dépendances PHP (prod)
RUN composer install --no-dev --optimize-autoloader --no-interaction
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
# Génération des clés JWT si absentes
RUN php bin/console lexik:jwt:generate-keypair --skip-if-exists
COPY frontend/ ./
ENV CI=1 \
NUXT_TELEMETRY_DISABLED=1 \
NUXT_PUBLIC_API_BASE=/api \
NUXT_PUBLIC_APP_BASE=/
RUN npm run generate
# Build du frontend
RUN cd frontend && npm ci && npm run build:dist && rm -rf node_modules
# --- Stage 3: Production image ---
FROM php:8.4-fpm AS production
RUN apt-get update && apt-get install -y \
libicu-dev libpq-dev libpng-dev libzip-dev libxml2-dev \
nginx supervisor \
&& docker-php-ext-install -j$(nproc) intl pdo_pgsql zip gd opcache \
&& rm -rf /var/lib/apt/lists/*
# PHP production config
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# PHP-FPM: forward worker output to stderr for docker logs
RUN echo "catch_workers_output = yes" >> /usr/local/etc/php-fpm.d/www.conf \
&& echo "decorate_workers_output = no" >> /usr/local/etc/php-fpm.d/www.conf
# Nginx: log to stdout/stderr
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# Remove default nginx site
RUN rm -f /etc/nginx/sites-enabled/default
# Configs
COPY infra/prod/supervisord.conf /etc/supervisor/conf.d/app.conf
COPY infra/prod/nginx.conf /etc/nginx/sites-enabled/coltura.conf
# Backend from stage 1
COPY --from=backend-build /app /var/www/html
# Frontend from stage 2
COPY --from=frontend-build /app/frontend/.output/public /var/www/html/frontend/.output/public
# Symfony needs a .env file to boot (variables are overridden by env_file in docker-compose)
RUN echo "APP_ENV=prod" > /var/www/html/.env
# Permissions
RUN chown -R www-data:www-data /var/www/html/var /var/www/html/frontend/dist
RUN mkdir -p /var/www/html/var /var/www/html/config/jwt \
&& chown -R www-data:www-data /var/www/html/var
# PHP prod config
COPY infra/prod/php-prod.ini /usr/local/etc/php/php.ini
WORKDIR /var/www/html
EXPOSE 80
EXPOSE 9000
# ── Nginx stage ──
FROM nginx:1.27-alpine AS nginx
COPY infra/prod/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=php-base /var/www/html/public /var/www/html/public
COPY --from=php-base /var/www/html/frontend/dist /var/www/html/frontend/dist
CMD ["supervisord", "-n", "-c", "/etc/supervisor/conf.d/app.conf"]

View File

@@ -1,42 +1,12 @@
services:
php:
container_name: php-coltura-fpm
build:
context: ../../
dockerfile: infra/deploy/Dockerfile
target: php-base
environment:
APP_ENV: prod
APP_DEBUG: 0
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?serverVersion=16&charset=utf8"
volumes:
- uploads_data:/var/www/html/var/uploads
depends_on:
- db
restart: unless-stopped
nginx:
container_name: nginx-coltura
build:
context: ../../
dockerfile: infra/deploy/Dockerfile
target: nginx
depends_on:
- php
app:
image: gitea.malio.fr/malio-dev/coltura:${COLTURA_IMAGE_TAG:-latest}
container_name: coltura-app
env_file: .env
ports:
- "${APP_PORT:-80}:80"
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- "8086:80"
volumes:
- pg_data:/var/lib/postgresql/data
- ./config/jwt:/var/www/html/config/jwt:ro
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
volumes:
pg_data:
uploads_data:

View File

@@ -2,16 +2,24 @@ server {
listen 80;
server_name _;
root /var/www/html/frontend/dist;
root /var/www/html/frontend/.output/public;
index index.html;
client_max_body_size 55m;
access_log /dev/stdout;
error_log /dev/stderr;
location ^~ /api/ {
root /var/www/html/public;
try_files $uri /index.php?$query_string;
}
location ^~ /bundles/ {
root /var/www/html/public;
try_files $uri =404;
}
location = /api/login_check {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
@@ -19,19 +27,15 @@ server {
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param PATH_INFO /login_check;
fastcgi_param REQUEST_URI /login_check;
fastcgi_pass php:9000;
}
location ^~ /bundles/ {
root /var/www/html/public;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
}
location ~ ^/index\.php(/|$) {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
fastcgi_param DOCUMENT_ROOT /var/www/html/public;
fastcgi_pass php:9000;
fastcgi_pass 127.0.0.1:9000;
internal;
}
location ~ \.php$ {

View File

@@ -0,0 +1,28 @@
[supervisord]
nodaemon=true
user=root
logfile=/dev/null
logfile_maxbytes=0
pidfile=/var/run/supervisord.pid
[program:php-fpm]
command=php-fpm -F
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stopasgroup=true
stopsignal=QUIT
[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stopasgroup=true
stopsignal=QUIT