Ajout de la configuration de Supercronic pour la configuration des tâches planifiées.
This commit is contained in:
@@ -17,6 +17,7 @@ RUN if echo "$SERVER_PHP_IMAGE" | grep -qi apache; then \
|
||||
fi
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
nano \
|
||||
git \
|
||||
mariadb-client \
|
||||
npm \
|
||||
@@ -35,6 +36,17 @@ RUN apt-get update && apt-get install -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Configuration de cron
|
||||
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.44/supercronic-linux-amd64 \
|
||||
SUPERCRONIC_SHA1SUM=6eb0a8e1e6673675dc67668c1a9b6409f79c37bc \
|
||||
SUPERCRONIC=supercronic-linux-amd64
|
||||
|
||||
RUN curl -fsSLO "$SUPERCRONIC_URL" \
|
||||
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
|
||||
&& chmod +x "$SUPERCRONIC" \
|
||||
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
|
||||
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
|
||||
|
||||
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
|
||||
|
||||
# Configuration pour Composer
|
||||
@@ -43,6 +55,4 @@ ENV COMPOSER_CACHE_DIR=/var/www/.cache/composer
|
||||
|
||||
# Configuration de NPM
|
||||
RUN mkdir -p /var/www/.npm && chown -R www-data:www-data /var/www/.npm
|
||||
ENV NPM_CONFIG_CACHE=/var/www/.npm
|
||||
|
||||
USER www-data
|
||||
ENV NPM_CONFIG_CACHE=/var/www/.npm
|
||||
@@ -1,11 +1,6 @@
|
||||
services:
|
||||
|
||||
server-php:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVER_PHP_IMAGE: ${APACHE_PHP_IMAGE}
|
||||
dockerfile: ${PWD}/docker/Dockerfile.server-php
|
||||
|
||||
environment:
|
||||
APACHE_ADMIN_EMAIL: ${APACHE_ADMIN_EMAIL}
|
||||
@@ -20,5 +15,3 @@ services:
|
||||
- ${PWD}/host/apache/conf/apache2.conf:/etc/apache2/conf-enabled/docker.conf
|
||||
- ${PWD}/host/php/conf/${OPCACHE_CONFIG_FILE:-opcache.default.ini}:/usr/local/etc/php/conf.d/opcache.ini
|
||||
- ${PWD}/upload:/app/public/upload
|
||||
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
@@ -0,0 +1,26 @@
|
||||
services:
|
||||
|
||||
cron:
|
||||
restart: unless-stopped
|
||||
container_name: ${CONTAINER_PREFIX}_cron
|
||||
|
||||
build:
|
||||
context: ${PWD}
|
||||
args:
|
||||
SERVER_PHP_IMAGE: ${SERVER_PHP_IMAGE}
|
||||
dockerfile: ${PWD}/docker/Dockerfile.server-php
|
||||
|
||||
command: supercronic /etc/crontab
|
||||
|
||||
environment:
|
||||
APP_PATH: ${APP_CONTAINER_PATH}
|
||||
|
||||
volumes:
|
||||
- ${PWD}/${APP_HOST_PATH}:${APP_CONTAINER_PATH}
|
||||
- ${PWD}/host/crontab:/etc/crontab
|
||||
|
||||
depends_on:
|
||||
- server-php
|
||||
|
||||
healthcheck:
|
||||
disable: true
|
||||
@@ -1,11 +1,6 @@
|
||||
services:
|
||||
|
||||
server-php:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVER_PHP_IMAGE: ${FRANKENPHP_IMAGE}
|
||||
dockerfile: ${PWD}/docker/Dockerfile.server-php
|
||||
|
||||
environment:
|
||||
FRANKENPHP_ROOT_PATH: ${FRANKENPHP_ROOT_PATH}
|
||||
@@ -18,11 +13,5 @@ services:
|
||||
- ${PWD}/host/php/conf/${OPCACHE_CONFIG_FILE:-opcache.default.ini}:/usr/local/etc/php/conf.d/opcache.ini
|
||||
- ${PWD}/upload:/app/public/upload
|
||||
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "curl -s http://localhost/server-php-test.php || exit 1" ]
|
||||
interval: 30s
|
||||
timeout: 1s
|
||||
retries: 10
|
||||
start_period: 1s
|
||||
disable: true
|
||||
|
||||
@@ -27,6 +27,13 @@ services:
|
||||
server-php:
|
||||
restart: unless-stopped
|
||||
container_name: ${CONTAINER_PREFIX}_server_php
|
||||
|
||||
build:
|
||||
context: ${PWD}
|
||||
args:
|
||||
SERVER_PHP_IMAGE: ${SERVER_PHP_IMAGE}
|
||||
dockerfile: ${PWD}/docker/Dockerfile.server-php
|
||||
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=frontend
|
||||
@@ -40,6 +47,8 @@ services:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
|
||||
# Configuration de PHPMyAdmin
|
||||
phpmyadmin:
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user