Remove user/permission management for Dokploy deployment

- Dockerfile: remove appuser creation, run everything as root
- www.conf: switch php-fpm workers to www-data
- entrypoint.sh: remove all chown and git safe.directory workarounds
- docker-compose.yml: remove USER_ID/GROUP_ID build args
- .env.example: remove USER_ID/GROUP_ID variables
This commit is contained in:
root
2026-04-05 19:54:12 +02:00
parent d38d8b7896
commit 16616adcfd
5 changed files with 5 additions and 32 deletions

View File

@@ -33,6 +33,3 @@ MAIL_FROM_ADDRESS="noreply@termanager2.local"
MAIL_FROM_NAME="${APP_NAME}"
MAILPIT_UI_PORT=8025
USER_ID=1000
GROUP_ID=1000

View File

@@ -2,9 +2,6 @@ services:
app:
build:
context: ./docker/php
args:
USER_ID: ${USER_ID:-1000}
GROUP_ID: ${GROUP_ID:-1000}
container_name: termanager2_app
restart: unless-stopped
working_dir: /var/www/html

View File

@@ -1,8 +1,5 @@
FROM php:8.3-fpm
ARG USER_ID=1000
ARG GROUP_ID=1000
# System dependencies
RUN apt-get update && apt-get install -y \
git \
@@ -42,26 +39,19 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create system user
RUN groupadd -g ${GROUP_ID} appuser \
&& useradd -u ${USER_ID} -g appuser -m appuser
# Set working directory
WORKDIR /var/www/html
# Copy PHP configuration
COPY php.ini /usr/local/etc/php/conf.d/custom.ini
# Copy PHP-FPM pool config (run workers as appuser)
# Copy PHP-FPM pool config
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
# Copy entrypoint
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Set ownership
RUN chown -R appuser:appuser /var/www/html
EXPOSE 9000
ENTRYPOINT ["entrypoint.sh"]

View File

@@ -5,12 +5,6 @@ echo "========================================="
echo " TerManager2 - Entrypoint"
echo "========================================="
# -----------------------------------------------
# 0. Fix permissions & git safe directory
# -----------------------------------------------
git config --global --add safe.directory /var/www/html
chown -R appuser:appuser /var/www/html/storage /var/www/html/bootstrap/cache
# -----------------------------------------------
# 1. Composer install
# -----------------------------------------------
@@ -93,11 +87,6 @@ echo "========================================="
echo " TerManager2 - Ready!"
echo "========================================="
# -----------------------------------------------
# Fix final ownership
# -----------------------------------------------
chown -R appuser:appuser /var/www/html/vendor /var/www/html/node_modules /var/www/html/public/build /var/www/html/storage /var/www/html/bootstrap/cache 2>/dev/null || true
# -----------------------------------------------
# Execute CMD (default: php-fpm)
# -----------------------------------------------

View File

@@ -1,9 +1,9 @@
[www]
user = appuser
group = appuser
user = www-data
group = www-data
listen = 0.0.0.0:9000
listen.owner = appuser
listen.group = appuser
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 20