Empty webapp complete

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank van den Berg
2026-07-01 23:10:46 +02:00
co-authored by Claude Sonnet 5
parent 4703d1f8bf
commit e503cf3930
63 changed files with 13245 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# Variables consumed by docker-compose.yml / docker-compose.override.yml.
# These are dev-only defaults; override with a docker/.env.local (gitignored)
# for anything that shouldn't be committed.
COMPOSE_PROJECT_NAME=share-control
# Matched against the host user so bind-mounted files (var/, vendor/) written
# by the php container stay owned by you instead of root. Override in a
# gitignored docker/.env.local if your UID/GID isn't the common 1000/1000.
UID=1000
GID=1000
NGINX_PORT=8080
MYSQL_DATABASE=app
MYSQL_USER=app
MYSQL_PASSWORD=!ChangeMe!
MYSQL_ROOT_PASSWORD=!ChangeMe!
RABBITMQ_DEFAULT_USER=guest
RABBITMQ_DEFAULT_PASS=guest
RABBITMQ_PORT=5672
RABBITMQ_MANAGEMENT_PORT=15672
MAILCATCHER_SMTP_PORT=1025
MAILCATCHER_WEB_PORT=1080
+6
View File
@@ -0,0 +1,6 @@
services:
mailcatcher:
image: sj26/mailcatcher
ports:
- "${MAILCATCHER_WEB_PORT:-1080}:1080"
- "${MAILCATCHER_SMTP_PORT:-1025}:1025"
+59
View File
@@ -0,0 +1,59 @@
services:
nginx:
image: nginx:alpine
depends_on:
- php
ports:
- "${NGINX_PORT:-8080}:80"
volumes:
- ../:/var/www/html:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
php:
build:
context: ./php
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
depends_on:
mysql:
condition: service_healthy
rabbitmq:
condition: service_healthy
volumes:
- ../:/var/www/html
mysql:
image: mysql:8.4
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-app}
MYSQL_USER: ${MYSQL_USER:-app}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-!ChangeMe!}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-!ChangeMe!}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-!ChangeMe!}"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- mysql_data:/var/lib/mysql
- ./mysql/conf.d:/etc/mysql/conf.d:ro
rabbitmq:
image: rabbitmq:4-management-alpine
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS:-guest}
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "${RABBITMQ_MANAGEMENT_PORT:-15672}:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
volumes:
mysql_data:
rabbitmq_data:
+3
View File
@@ -0,0 +1,3 @@
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
+25
View File
@@ -0,0 +1,25 @@
server {
listen 80;
server_name localhost;
root /var/www/html/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
internal;
}
location ~ \.php$ {
return 404;
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
+28
View File
@@ -0,0 +1,28 @@
FROM php:8.4-fpm-alpine
ARG UID=1000
ARG GID=1000
RUN apk add --no-cache \
icu-dev \
rabbitmq-c-dev \
libzip-dev \
$PHPIZE_DEPS \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j"$(nproc)" intl pdo_mysql zip opcache \
&& pecl install amqp \
&& docker-php-ext-enable amqp \
&& apk del $PHPIZE_DEPS
# Re-key www-data to the host UID/GID so files written into the bind-mounted
# app directory (var/, vendor/) stay owned by the host user, not root.
RUN deluser www-data 2>/dev/null || true \
&& delgroup www-data 2>/dev/null || true \
&& addgroup -g "${GID}" www-data \
&& adduser -D -H -u "${UID}" -G www-data -s /sbin/nologin www-data
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY conf.d/symfony.ini /usr/local/etc/php/conf.d/symfony.ini
WORKDIR /var/www/html
USER www-data
+8
View File
@@ -0,0 +1,8 @@
date.timezone=UTC
memory_limit=256M
upload_max_filesize=20M
post_max_size=20M
opcache.enable=1
opcache.validate_timestamps=1
opcache.max_accelerated_files=20000